Import MySQL database
Import MySQL database
The MySQL import feature allows you to migrate data from an external MySQL database directly into your service. The platform handles the entire process for you, streaming data from your source database without requiring temporary files or manual command-line work.
WARNING: DESTRUCTIVE OPERATION
The import process will permanently overwrite all tables in your target database that exist in the source database. If the import fails or is interrupted, your target database may be left in an incomplete state.
We strongly recommend creating a backup of your target database before importing.
Prerequisites
Before starting an import, ensure you have:
- An active MySQL service in your application
- The MySQL service must be in "active" status
- Source database connection details:
- Hostname or IP address
- Port number (typically 3306)
- Database username with read permissions
- Database password
- Database name
- Network connectivity from the platform to your source database
Network accessibility
The import connection originates from within the platform's infrastructure, not from your local machine. Your source database must be accessible from the internet.
How to import a database
Step 1: Navigate to your MySQL service
- Go to your application's overview page
- Find your MySQL service in the services list
- Click the three-dot menu (⋮) next to the service
Step 2: Start the import
- Select "Import database" from the dropdown menu
- A modal will appear requesting source database details
Step 3: Enter source database details
Fill in the connection details for the database you want to import from:
- Host: The hostname or IP address of your source MySQL server
- Port: The port number (default is 3306)
- Username: A MySQL user with read access to the source database
- Password: The password for the MySQL user
- Database: The name of the database to import
Step 4: Start the import
- Review your connection details carefully
- Click "Start import" to begin the process
- The import will start immediately in the background
Monitoring import progress
Once started, you can monitor the import in real-time:
- The service overview will show "Import in progress"
- Click "View import logs" to see detailed progress
- The logs display:
- Connection status to the source database
- Tables being imported
- Row counts and progress
- Any errors that occur
Import completion
The import typically completes within a few minutes for small databases, but may take longer for larger datasets. The logs will show "Import completed successfully!" when finished.
After completion, the import job and all associated resources are automatically cleaned up within one hour.
Limitations
- MySQL only: This feature currently only works with MySQL services. PostgreSQL and MongoDB are not supported.
- No rollback: If an import fails partway through, there is no automatic rollback. Your target database may contain partial data.
- Overwrites data: Existing tables in the target database are replaced with source data. This cannot be undone.
- No retry: Failed imports do not automatically retry. You must start a new import after resolving the issue.
- One import at a time: Only one import can run per service. Starting a new import will cancel any previous running import.
Frequently asked questions
How do I import a .sql dump into a hosted MySQL database?
Enable debug access to your MySQL service, SSH in, then pipe the dump into the mysql client: `mysql -u <user> -p <database> < dump.sql`. Disable debug access when done.
Can I import a database without SSH access?
Yes. Use the platform import flow: upload a `.sql` dump (or supply remote MySQL credentials) and the platform streams the data into your service. No SSH or command-line work required.
What is the maximum dump file size for import?
There is no hard upper limit on the dump itself, but very large imports may run into transaction-log or volume size constraints on the target database. For dumps over a few GB, prefer streaming from a remote source rather than uploading a single file.
Does the import process support compressed (.gz) files?
Yes. Pipe `gunzip` into mysql when using SSH: `gunzip < dump.sql.gz | mysql -u <user> -p <database>`. The platform-level upload flow accepts uncompressed `.sql` only — gunzip locally first.
What if the import fails halfway through?
MySQL processes statements sequentially, so a failure leaves the partial state behind. Re-run after fixing the offending statement (often a duplicate key or schema mismatch). For idempotent imports, wrap your dump in `DROP TABLE IF EXISTS` statements.