Add Database
The Database import requires a single .sql
dump that contains the site's content and configurations.
Navigate to your existing site's Dashboard.
In the Live environment, select Database / Files.
Click Export Database.
Download the resulting file, or copy the URL for archives over 500 MB.
Import the archive:
Select the Dev environment in the Site Dashboard.
Select Database / Files.
Click Import and add your archive accordingly (based on file size):
If your archive is under 100MB, upload the file directly:
Navigate to the MySQL database field > click File > Choose File.
Select your local archive file > click Import.
Note: If you recently imported the database and need to re-import, refresh the page and use a new filename for the database file.
If your archive is less than 500MB, import it from URL:
Navigate to the MySQL database field.
Click URL.
Paste a publicly accessible URL for the
.sql.gz
file > click Import.Info:NoteChange the end of Dropbox URLs from
dl=0
todl=1
to import your archive correctly.
The following instructions allow you to add database archives larger than 500MBs using the command line MySQL client. You can also use a GUI client like Sequel Ace or Navicat. For more information, see Accessing MySQL Databases.
Navigate to the Pantheon Site Dashboard.
Open the Dev environment.
Click Connection Info.
Copy the Database connection string.
The Database connection string will look similar to this:
mysql -u pantheon -p{random-password} -h dbserver.dev.{site-id}.drush.in -P {site-port} pantheon
cd
into the directory containing your.sql
file in your terminal.Paste the connection string and append it with:
< database.sql
.Your command will look like:
mysql -u pantheon -p{random-password} -h dbserver.dev.{site-id}.drush.in -P {site-port} pantheon < database.sql
If you encounter a connection-related error, the DB server could be in sleep mode. To resolve this, load the site in your browser to wake it up, and try again. For more information, see Troubleshooting MySQL Connections.
The
.sql
file is imported to the Dev environment after you run the command.