Your application already runs here, but its data is still on the old host. Move an existing database here loads that data into your site's own database, by itself, in a few minutes. It works for a MySQL or MariaDB database and for a PostgreSQL one, and it never writes to your old host: we only read from it.
Before you start
- The site is live and has its own database. No database yet? Create one first: see Your site's databases.
- Your export has to come from the same engine as the database here: MySQL or MariaDB into MariaDB, PostgreSQL into PostgreSQL. We move a database between hosts; we do not convert it between engines.
- You are an owner, admin or developer on the account.
- If the database here may hold data you want to keep, take a backup first.
1. Open the page
Open Sites → your site → Databases and press Move an existing database here under the site's own database. The Move a database here page opens, headed with the name of the database it loads into.
2. Say where the database is now
Under Where is the database now? choose one:
- I have an export: a
.sqlfile, a.sql.gz, or apg_dumpcustom-format archive. Choose it under Your database export. The page says the largest file it takes. The file goes up in parts, so a slow connection or a large file is fine; leave the tab open until the bar fills. - Take it from my old host: we sign in to your old host and run the export there ourselves, so there is nothing to upload. Fill in the Protocol (SFTP (SSH), FTPS (FTP over TLS) or FTP (plain)), Host, Port and Username. Under Sign in with, choose Password, or SSH private key (SFTP only) and paste the key under Private key. Then, under The database on your old host, its Database name, Database user, Database password and Database host (usually
localhost, as your application's config writes it).
The details for your old host are encrypted, handed to the export job once, and deleted the moment it starts.
3. Confirm the engine
Under Which engine wrote the database you are moving? the engine of the database here is already picked. Choosing the other one is refused, with nothing changed. A dump that turns out to be from the other engine is refused the same way.
4. Decide what happens to tables already there
Under If DATABASE_NAME already has tables in it:
- Stop, and change nothing (the default): we check before we write anything. If there are tables, the migration stops, tells you, and your data stays exactly as it is.
- Replace everything in this database: every table in the database here is dropped and your export is loaded over it.
Caution: Replace everything in this database deletes the data that is in the database now, and there is no undo. To choose it, type the database's name where the form asks.
5. Start it
Press Start the migration. The page follows along: Receiving your dump, Queued, then Moving your database in, with the step it is on and a Technical log. You can leave the page while it loads; it carries on without you.
Until it starts loading, you can press Cancel this migration; nothing in your database changes. Once it is loading it cannot be cancelled.
When it is done, the page says Your data is in DATABASE_NAME. Whatever already points at that database, your site included, reads the new data straight away: there is nothing to switch over. Open it in Databases to look at the tables.
If it fails
A migration that stops part-way is not rolled back, so the database may now hold part of your export. To try again, start again and choose Replace everything in this database, so the partial load is cleared first. If it stops the same way, send us the technical log from the page and we finish the move for you.
When the page says no
The page explains why a database cannot take a migration yet:
- The site, or its database, is still being set up. The page opens as soon as it is ready.
- It is a warehouse database. Those are filled from data files, not from a database dump.
- We do not hold the password for the database. Rotate its password on the site's Databases tab and try again.
- The site is managed for you; the page offers our assisted migration instead.