Vault Migration to Amazon S3
This section explains how to migrate an existing file-based vault to Amazon S3. For information on how to set up Amazon S3 cloud configuration, see the topic
Configuring Windchill File Vaults to Use Amazon S3 . The following workflow illustrates how to migrate a single vault at a time. This process is applicable for all types of vaults that is Master, Replica, or Cache vault and for vaults at master as well as file server site. This process only works for a vault only if the
Automatic folder creation flag is set to
true.
![](../Windchill_Help_Center/images/vaultui_vaultmigration.png)
The process of migrating a vault is split into four top level steps as illustrated above. All these steps have been provided with examples. For ease of explaining the migration process, the following procedure is based on a sample scenario where
defaultuploadrootfolder is the RootFolder name and the mount paths as:
![](../Windchill_Help_Center/images/vaultui_source.png)
Prepare system for migration
Perform the following steps to complete the preparatory work like such as performing re-vaulting, synchronizing, removing unreferenced files, and mark Root Folder read- only.
1. Run re-vaulting schedule for Vault, if vault is Master vault.
2. Cancel and disable content replication schedules for Vault, if vault is Replica vault.
3. Using a JMX client such as JConsole, perform the CacheVaultSynchronizer MBean sysForceSync operation.
4. Perform Remove Unreferenced Files and > operations for Vault, so that only valid content is migrated to Amazon S3.
6. Set the file based RootFolders that you plan to migrate, as READ_ONLY from the vault configuration user interface. This ensures that no new content is uploaded to file based RootFolders, while its contents are migrated.
Copy content from source system.
Perform the following steps to copy content from source system to target system, for example, copy content from file system to the target Amazon S3 system .
Copy the directory structure corresponding to RootFolders on the file system to Amazon S3.
• If you want to copy the RootFolder content on EC2 instance, use the Amazon Command Line tool
(awscli). For example,
aws s3 cp C:\PTC\Windchill\vaults\defaultuploadvault
s3://Testbucket/defaultuploadvault-–recursive
Specify the encryption options from the following while copying the directory structure.
◦ Option ‘--sse’ encrypts the content using AES256.
◦ Option ‘--sse amws:kms’ uses default AWS KMS Key ID for encryption.
◦ Option ‘--sse aws:kms --sse-kms-key-id <keyid>’ use specified Keyid for encryption.
Validate the copied content
This step is required to make sure the previous step of copying content was successful and accurate.
1. Run the data validation utility, DataMigrationVerificationTool, to assert the copied contents on Amazon S3. This tool allows you to compare contents of existing vault to file structure on Amazon S3. You can run the tool on master Windchill and also for remote installations. Run the following at the Windchill shell:
windchill wt.fv.tools.datamigration.DataMigrationVerificationTool
validateMigratedData --userName USER --password PASSWORD --
rootFolderName ROOT_FOLDER_NAME --mountType MOUNT_TYPE--folderName FOLDER_NAME
--mountPath MOUNT_PATH –skipSizeValidation
2. On execution, the tool provides the location at which the report is saved. In this report, you can view a list of all the missing files or information about file size mismatch for each folder. The report always gets generated on master installation. You can choose to run validation , if the whole root folder or only selected sub-folder by specifying -- rootFolderName or -- folderName. You can also allows to skip performing file size validation, using by adding –skipSizeValidation.
For examples:
◦ To validate all data in root folder named defaultuploadrootfolder:
windchill wt.fv.tools.datamigration.DataMigrationVerificationTool validateMigratedData --userName wcadmin --password wcadmin --mountType amazonS3 --rootFolderName defaultuploadrootfolder--mountPath Testbucket/defaultuploadvault
◦ To validate data in folder named defaultuploadrootfolder and not to check file sizes
windchill wt.fv.tools.datamigration.DataMigrationVerificationTool validateMigratedData --userName wcadmin --password wcadmin --mountType amazonS3 --folderName defaultuploadrootfolder --mountPath Testbucket/defaultuploadvault --skipSizeValidation
Update mount
When the mounts are updated, the system starts using the content in target system. Perform the following steps to update mounts:
1. Run the following command from Windchill shell to change the mount type and mount path for all the RootFolders:
windchill wt.objectstorage.tools.MountMigrationTool migrate -u <username> -p <password> -r <RootFolder name> -m <mount path on Amazon S3> -t amazonS3
For example:
windchill wt.fv.tools.datamigration.MountMigrationTool migrate -u <username> -p <password> -r defaultuploadfolder1 -m Testbucket/defaultuploadvault -t amazonS3
Alternatively, you can unmount the Root folder and mount it for Amazon S3 from Vault Configuration user interface. But while performing these operations from user interface, end users may not access content in RootFolder.
2. Remove the RootFolders READ_ONLY flag from vault configuration user interface. The newly created RootFolder in the Prepare system for migration section may contain files which are not required to move out of the RootFolder as part of this vault migration process.
3. After vault migration process, re-establish the re-vaulting and content replication schedules.
Cheat Sheet
windchill wt.fv.tools.FolderToRootFolderConverter
aws s3 cp C:\PTC\Windchill\vaults\defaultuploadvault s3://Testbucket/defaultuploadvault –recursive
snowball.bat start -i <ip address> -u <unlock code> -m <manifest file path>
snowball.bat ls
snowball.bat test -r <vault mount path on host machine>
snowball.bat mkdir s3://<bucketname>/<vaultname>
snowball.bat cp -r <path to vault> s3://<bucketname>/<vaultname>
snowball.bat validate <path on Amazon Snowball>
snowball.bat stop
windchill wt.fv.tools.datamigration.DataMigrationVerificationTool validateMigratedData --userName USER --password PASSWORD --rootFolderName ROOT_FOLDER_NAME --mountType MOUNT_TYPE --folderName FOLDER_NAME --mountPath MOUNT_PATH --skipSizeValidation
windchill wt.objectstorage.tools.MountMigrationTool migrate -u <username> -p <password> -r <RootFolder name> -m <mount path on Amazon S3> -t amazonS3