Migrating CARTO Self-hosted installation to an external database (Helm)
For CARTO Self-hosted using Kubernetes and Helm
This documentation only applies to advanced Orchestrated container deployments using Kubernetes and Helm
This guide outlines the steps to migrate the internal database of a CARTO Self-Hosted installation to an external database. By following these steps, you can seamlessly transition your CARTO workspace to a new database environment.
Prerequisites
Before starting the migration process, ensure that you have the following:
Access to the CARTO Self-Hosted installation
Credentials for the external database (hostname, port, username, password)
How to perform the migration to an external database
Step 1: Dump the Container Database
Use the following command to create a dump of the internal database:
Obtain the PostgreSQL password generated by the CARTO installation from the secret created for postgresql:
You can obtain the name of your PostgreSQL secret running the following command:
kubectl get secrets -n <namespace>
Obtain the name of your
workspace database
pod. The following command should return a pod namedpostgresql
Run the following command to perform a backup of the internal database located in your cluster:
This command exports the database structure and data to a SQL file named dump.sql
Step 2: Create Workspace Admin User in External Database
Run the following command to create the necessary user in the new external database:
Step 3: Create Database in External Database
Execute the following commands to create the database in the external database:
Step 4: Restore the Dump
Restore the dumped data into the new external database. If you have access to the external database using psql
you can directly restore the database using the following command:
You have successfully migrated your CARTO Self-Hosted installation to an external database! 🎉 Ensure that you update your CARTO configuration files to reflect the changes in the database connection details. You can find more information about how to connect your Self-Hosted installation to an external database in our quickstart guides.
Last updated
Was this helpful?