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 are 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.
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:
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. Run the following command to set your vault as Automatic Folder Creation.
windchill wt.fv.tools.FolderToRootFolderConverter
7. 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.
| Before validating the copied content, configure Amazon S3 cloud service by running the following command in the Windchill shell:windchill com.ptc.windchill.objectstorage.amazons3.tools.S3ConfigurationTool configure -u <username> -p <password> |
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 -r <srcRootFolderName> -t <targetMountType> -m <targetMountPath> -u <userName> -p <password>
For help, run the tool with -h parameter.
Following are the optional parameters:
-f <srcSubFolderName>
-s <skipSizeValidation>
-h <Help>
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 skip performing file size validation, by adding --skipSizeValidation.
For examples:
◦ To validate all data in root folder named defaultuploadrootfolder:
windchill wt.fv.tools.datamigration.DataMigrationVerificationTool validateMigratedData -r defaultuploadrootfolder -t amazonS3 -m Testbucket/defaultuploadvault -u userName -p password
Update mount
| Before updating mount, configure Amazon S3 cloud service by running the following command in the Windchill shell:windchill com.ptc.windchill.objectstorage.amazons3.tools.S3ConfigurationTool configure -u <username> -p <password> |
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.fv.tools.datamigration.MountMigrationTool migrate -r <rootFolderName> -t <newMountType> -m <newMountPath> -u <userName> -p <password>
For help, run the tool with -h parameter.
Following are the optional parameters:
-v <verbose>
-h <Help>
For example:
windchill wt.fv.tools.datamigration.MountMigrationTool migrate -r defaultuploadrootfolder -t amazonS3 -m Testbucket/defaultuploadvault -u <username> -p <password>
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, and configure the property wt.fv.faultTolerantVaultsAutoRestore.
Summary of Commands
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 com.ptc.windchill.objectstorage.amazons3.tools.S3ConfigurationTool configure -u <username> -p <password>
windchill wt.fv.tools.datamigration.DataMigrationVerificationTool validateMigratedData -r <srcRootFolderName> -t <targetMountType> -m <targetMountPath> -u <userName> -p <password>
windchill wt.fv.tools.datamigration.MountMigrationTool migrate -r defaultuploadrootfolder -t amazonS3 -m Testbucket/defaultuploadvault -u <userName> -p <password>