Migrating an Existing Nexus Repository Instance to a Resiliency Architecture
Migrating an existing Nexus Repository instance to a resilient architecture requires migrating to a PostgreSQL database (preferably cloud-based) and then migrating your blobs before setting up the architecture outlined in one of our resilient deployment examples.
The sections below describe the necessary steps for migrating.
Prerequisite: Migrating to a PostgreSQL Database
Regardless of whether you are migrating from on-premises to on-premises or migrating to the cloud, you will need to be using a PostgreSQL database to use any of our resilient deployment options. If you are migrating to the cloud, you can migrate to AWS Aurora or RDS PostgreSQL, Azure Database for PostgreSQL, or any self-hosted PostgreSQL database in your cloud environment.
If your existing instance is using OrientDB or H2, you will first need to follow these instructions for migrating to PostgreSQL.
Migrating an On-Premises Single Nexus Repository Instance to an On-Premises Resilient Deployment
To migrate from an on-premises single Nexus Repository instance to an on-premises resilient deployment, complete the following steps:
1. First, migrate to a PostgreSQL database.
2. After migration, ensure that you have database scheduled backups configured; if not, you should kick this off manually and consider scheduling backups.
3. After migrating your database, follow the instructions for setting up the architecture in our Single Data Center On-Premises Deployment Example Using Kubernetes.
Migrating a Single Cloud Nexus Repository Instance to a Resilient Cloud Deployment (AWS/Azure)
To migrate from a single cloud Nexus Repository instance to a resilient cloud deployment using AWS or Azure, complete the following steps:
1. First, migrate to a PostgreSQL database. (You can migrate to AWS Aurora or RDS PostgreSQL, Azure Database for PostgreSQL, or any self-hosted PostgreSQL database in your cloud environment.)
2. After migration, ensure that you have database scheduled backups configured; if not, you should kick this off manually and consider scheduling backups.
3. Move blobs to either Amazon Simple Storage Service (S3) or Azure Blob:
a. Moving to Amazon S3 - Migrating from file blob storage to Amazon S3 requires copying blobs to S3 using a tool such as AWS DataSync. Amazon provides documentation for using DataSync to move data between other storage systems and AWS storage services.
b. Moving to Azure Blob - In order to migrate to Azure Blob, you must copy blobs to Azure Blob using a tool such as AzCopy. Microsoft provides documentation for using AzCopy to move data to and from Azure Blob.
4. Update the blob store configuration in your database to match the new type of blob store and new location.
a. Create the new blob store in your Sonatype Nexus Repository instance.
b. Shut down Sonatype Nexus Repository.
c. Run a SQL query like the following:
delete from blob_store_configuration where name = '<blob store name>'; -- the name of the blob store which was moved to S3/Azure -- update the reference to the new S3 blob store update blob_store_configuration set name = '<blob store name>' where type = '<S3 or Azure Cloud Storage>' and name = '<name of the new blob store>';
d. Re-start your Sonatype Nexus Repository instance.
5. After migrating your database and blob store, refer to to Single-Node Cloud Resilient Deployment Example Using AWS or Single-Node Cloud Resilient Deployment Example Using Azure for instructions on setting up the resilient architecture.
Migrating an On-Premises Single Nexus Repository Instance to a Resilient Cloud Deployment (AWS/Azure)
To migrate from a single on-premises Nexus Repository instance to a resilient cloud deployment using AWS or Azure, complete the following steps:
1. First, migrate your database to Aurora PostgreSQL or Azure Database for PostgreSQL.
2. After migration, ensure that you have database scheduled backups configured; if not, you should kick this off manually and consider scheduling backups.
3. Move blobs to either Amazon Simple Storage Service (S3) or Azure Blob:
a. Moving to Amazon S3 - Migrating from file blob storage to Amazon S3 requires copying blobs to S3 using a tool such as AWS DataSync. Amazon provides documentation for using DataSync to move data between other storage systems and AWS storage services.
b. Moving to Azure Blob - In order to migrate to Azure Blob, you must copy blobs to Azure Blob using a tool such as AzCopy. Microsoft provides documentation for using AzCopy to move data to and from Azure Blob.
4. Update the blob store configuration in your database to match the new type of blob store and new location.
a. Create the new blob store in your Sonatype Nexus Repository instance.
b. Shut down Sonatype Nexus Repository.
c. Run a SQL query like the following:
delete from blob_store_configuration where name = '<blob store name>'; -- the name of the blob store which was moved to S3/Azure -- update the reference to the new S3 blob store update blob_store_configuration set name = '<blob store name>' where type = '<S3 or Azure Cloud Storage>' and name = '<name of the new blob store>';
d. Re-start your Sonatype Nexus Repository instance.
5. After migrating your database and blob store, refer to Single-Node Cloud Resilient Deployment Example Using AWS or Single-Node Cloud Resilient Deployment Example Using Azure for instructions on setting up the resilient architecture.