Best practices for importing and exporting
The following are best practices you should consider when importing and exporting data:
- Don't use Requester Pays buckets
- Use the correct flags when you create a SQL dump file
- Compress data to reduce cost
Don't use Requester Pays buckets
You cannot use a bucket that has Requester Pays enabled for imports and exports from Cloud SQL.
Use the correct flags when you create a SQL dump file
If you do not use the right procedure when you export data to a SQL dump file, your import might be unsuccessful. For information about creating a SQL dump file for import into Cloud SQL, see Exporting data.
Compress data to reduce cost
Cloud SQL supports importing and exporting both compressed and uncompressed files. Compression can save significant storage space on Cloud Storage and reduce your storage costs, especially when you are exporting large instances.
When you export a BAK file, use a
file extension to compress the data. When you import a file with an
.gz, it is decompressed automatically.
Tips for long-running import and export processes
Imports and exports into Cloud SQL using the import functionality (via a Cloud Storage bucket) can take a long time to complete, depending on the size of the database. This can have the following impacts:
- You cannot stop a long-running operation.
- You can perform only one import or export operation at a time for each instance.
You can decrease the amount of time it takes to complete each operation by using the Cloud SQL import or export functionality with smaller batches of data.