Before upgrading Snapcenter 2 or 3 to any other version it is recommended that you back up the SC repository. The guide lists running a PowerShell command protect-smrepository. When you run this however you usually end up with a bunch of different errors. This is due to the fact there are steps missing from NetApp’s guide.
The first thing missing is there are prerequisites to get it working.
Prerequisites
- Add the Snapcenter server as a host to the Snapcenter server
- Select the Windows plug in only. This adds the PowerShell commands needed to make snapshots of the drive you place the repository backups.
- The SC server must have a Netapp LUN (iSCSI, FCOE, FC) for the backup metadata.
- VMDK’s will work but seem to not have been tested.
The caveats to using a vmdk are this:
- Snapcenter vSphere plugin must be added to the vSphere server the VM is under.
- Datastores are on Netapp either VMFS, NFS and configured for backup by the SC vSphere plugin.
- Snapshots will be created in that volume so if this is a datastore protecting a large amount of VM’s and you could be close to the 255 limit of snaps you may want to have a dedicate DS for the drive.
Once the prerequisites are done then the SC install guide steps on creating a backup are pretty close. I tested on SC4 and SC3 but should work on SC2. In the guide it has you load the powershell modules. On my system i had no issue running the commands.
- Open a PowerShell window as admin.
- Run the command open-smconnection
- Enter a SC admin credentials when prompted
- Run the protect-smrepository command
- protect-smrepository -hostname servername.FQDN -path d:\scbackup -schedule @{“scheduletype”=”Daily”;”starttime”=”01/31/2018 10:00 AM”}
The backup does create snapshots in the volume for the VMDK or LUN that you put the backup file on. It seems more likely that the Repository should reside on a NetApp LUN and the snaps are possibly a before backup and after backup as it creates two snaps when the command runs.
Migrating SC Repository
One other note in the SC4 guide it states the command protect-smrepository does this:
- Moves the SnapCenter repository from one disk to another disk; the destination must be NetApp
It really doesn’t. In the protect command the path section states where the backup data will go. You will find folders with a xml file relating to the backup and a dump file of the database at the location you specified.
The database if you didn’t create a screenshot during install is located in the hidden folder *:\ProgramData for the drive you installed the program too.
On one server i had upgraded from SC2 to 3 to 3.0.1 and on another i had done a fresh install of SC4. But both were under the ProgramData folder.
- Upgraded – c:\ProgramData\MySql\MySQL Server 5.x <version number may differ>\Data
- SC4 or newer – C:\ProgramData\NetApp\SnapCenter\MySQLData\Data
If you do want to move the database use these steps:
- Stop the snapcenter service
- Stop the MySQL service
- Use Robocopy or other preferred method to copy the “Data” folder and files with permissions to your new drive and locale. Leave the other files in their original location.
- i.e Robocopy c:\source e:\destination /s /sec
- The next step is very important as the MYSql service wont start if you get it wrong. You must edit the my.ini* file specifically the datadir path:
datadir=C:/ProgramData/NetApp/SnapCenter/MySQL Data\Data
To reflect where you copied the data files in my case this was the G:\ drive.
datadir=G:/MySQL Server 5.7\Data
*Edit the my.ini in the original install location this should be in the folder above the Data folder.
- Start the MySQL service
- Start the Snapcenter service
- Log into Snapcenter and validate you can see hosts, Resources etc.