ARTIFACTORY: Migration from FileStore to NFS
Artifactory supports several storage providers for binary storage such as NFS and cloud storage providers such as S3, Google Cloud Storage, Azure Blob Storage. The location where Artifactory stores binaries is called filestore. The default filestore location is “$JFROG_HOME/artifactory/var/data/artifactory/filestore” and it can be managed by configuring the binarystore.xml file located in “$JFROG_HOME/artifactory/var/etc/artifactory/binarystore.xml”. We can configure this file for Artifactory to use a network file system, local disks or any cloud storage provider as a filestore. It’s also possible to migrate the filestore as and when required by changing the binarystore.xml by pointing to the new storage provider, however we also need to migrate the data stored in the current filestore to the newer filestore else Artifactory would not serve the previously deployed artifacts and might have error as mentioned in this article. Here, we will demonstrate how to migrate from a local disk as a filestore to NFS.
Setting up NFS as filestoreIn order to set NFS as a filestore we need to change the configuration in the binarystore.xml file. Use the following steps to change the configuration.
- Edit the binarystore.xml which is generally located at “$JFROG_HOME/artifactory/var/etc/artifactory/binarystore.xml”, and set it to this
<config version="v1">
<chain template="file-system"/>
<provider id="file-system" type="file-system">
<fileStoreDir>[NFS FILESTORE MOUNT]</fileStoreDir>
</provider>
</config>- Restart artifactory to get the changes.
Now your artifactory will use NFS as a binary filestore. If you have files already deployed to the artifactory before configuring the new filestore, you need to migrate that data to the new filestore. Follow the next step to migrate data from filestore to NFS.
To migrate files from Filestore to NFSOnce the binarystore.xml is set to NFS, you can follow the steps below to migrate data from filestore to NFS.
- Go to your filestore. The default filestore location is “$JFROG_HOME/artifactory/var/data/artifactory/filestore”.
- Copy all the files from the previous filestore to [NFS FILESTORE MOUNT], we can use rsync or any copy utilities to perform this step.
Once the above steps are complete, its recommended to perform a clean restart of Artifactory to ensure all changes are effective.