Migrate your data to a service
To move your data from self-hosted TimescaleDB instance to a service, run the following commands from your migration machine:
- Take offline the applications that connect to the source self-hosted TimescaleDB instance
The duration of migration is proportional to the amount of data stored in your database. By disconnecting your app from your database, you avoid possible data loss.
- Set your connection strings
These variables hold the connection information for the source self-hosted TimescaleDB instance and the target service:
Dump the data from your source Tiger Cloud service
Put your target service in the right state for restoring
Upload your data to the target service
The --jobs option specifies the number of CPUs to use to dump and restore the database concurrently.
Return your target service to normal operations
Connect to your new database and update your table statistics by running [
ANALYZE] [analyze] on your entire dataset:
To migrate from multiple databases, you repeat this migration procedure one database after another.
If you see the following errors during migration, you can safely ignore them. The migration still runs successfully.
===== PAGE: https://docs.tigerdata.com/mst/restapi/ =====
Examples:
Example 1 (bash):
export SOURCE="postgres://<user>:<password>@<source host>:<source port>/<db_name>"
export TARGET="postgres://tsdbadmin:<password>@<host>:<port>/defaultdb?sslmode=require"Example 2 (bash):
pg_dump -d "source" --no-owner -Fc -v -f dump.bakExample 3 (bash):
psql -d "target" -c "SELECT timescaledb_pre_restore();"Example 4 (bash):
pg_restore -d "target" --jobs 4 -Fc dump.bak