One of the first things you may need to do after setting up your Managed Database Hosting with Provider.lk is moving an existing database into your new hosting or creating a backup copy of your database. This guide explains how to import and export databases using phpMyAdmin.
Why Import and Export?
- Importing allows you to upload an existing database (for example, from your old hosting provider or a local development environment) into your Provider.lk hosting.
- Exporting creates a backup copy of your current database, which you can restore later if needed.
Both are essential for safe data management and disaster recovery.
1. Importing a Database
Steps to Import:
- Log in to phpMyAdmin using the Control Panel URL from your welcome email.
- In the left-hand sidebar, click your database name.
- At the top menu, select Import.
- Click Choose File and select your .sql or .zip backup file.
- Leave the default settings unless you have a specific reason to change them.
- Scroll down and click Go.
If successful, you’ll see a green confirmation message saying Import has been successfully finished.
Common Important Issues & Fixes.
- File size too large: phpMyAdmin may limit uploads (e.g., 2MB or 50MB). If your file is bigger:
-Split the SQL file into smaller parts.
-Use a compressed .zip version of the SQL file. - Timeout errors: Import large databases during off-peak hours.
- Encoding/character set mismatch: Make sure the exported file uses UTF-8 encoding if your database contains special characters.
Safety Concerns.
- It’s recommended to back up the current database before importing in case something goes wrong.
2. Exporting a Database (Backup)
Steps to Export:
- Log in to phpMyAdmin.
- Select your database from the left-hand sidebar.
- Click the Export tab.
- Choose one of the following options:
-Quick Export: Recommended for most cases; exports the entire database as a .sql file.
-Custom Export: Allows you to choose specific tables, output format, and advanced options. - Select the format (SQL is most common).
- Click Go. A download will begin, and your database will be saved to your computer.
Backup Best Practices
- Keep multiple backup copies (e.g., local computer + cloud storage).
- Export your database before making major changes.
- Regularly schedule backups (weekly or monthly, depending on activity).
Best Practices for Smooth Database Transfers
- Always test your database import/export on a staging environment before applying to live systems.
- Avoid using weak internet connections during imports to prevent file corruption.