If you are moving to Shockbyte from another host or have an existing database you wish to move to our servers, you can follow this guide to import your database backup.
You can import a database backup (.sql file) to your server database via PHPMyAdmin, or by a tool such as MySQL Workbench. Alternatively, if you are an advanced user you can also use the MySQL client via command line to connect directly to your database.
Important
Before following this guide, you will need a backup file of the database you wish to import, in .sql
format.
# Importing a Database Backup via PHPMyAdmin
You will be able to import a database backup using PHPMyAdmin.
- On the server control panel, navigate to Databases underĀ Server SettingsĀ on the left menu**.** On this page, you will find your database login details (if you don't have a database yet, hit Create Database).
- Click the Admin link for the database you wish to use. This will take you to the PHPMyAdmin database management panel.
- Once the PHPMyAdmin page loads, you will see a login form with the PHPMyAdmin logo. Enter your Username and Password from the MySQL Database page to login.
- Once logged in, select your database on the left hand side. It will be named similar to:
db_0001
. - Click "Import" on the menu at the top.
- You will now see an option to upload a
.sql
or.sql.zip
file. Upload your database backup to this page, then click Go. - Once the upload is complete, the database will be imported and everything is complete.
Note that there is a file size limit (2MB) and a time limit to upload the file. If your .sql file is larger than the requirements, you will need to connect to your database directly using the method below, rather than the web interface.
# Importing a Database Backup via MySQL Workbench
You will be able to import a Database using MySQL Workbench.
- Download and install the community edition of MySQL Workbench for your operating system.
- Once you have opened MySQL Workbench, add a new connection by clicking the + button next to MySQL Connections. Alternatively, navigate to Database > Manage Connections.
- Enter a name for the connection and your database login details.
These can be found on the server control panel by navigating to Databases underĀ Server SettingsĀ on the left menu**.** If you don't have a database yet, hit Create Database. If you see an error here, it usually means you have entered the details incorrectly. However, if it connects successfully but a warning message is displayed, the warning can usually be safely ignored as long as the connection is working correctly.
- Once you have entered your details and connected to the database in MySQL Workbench, click Server along on the top bar, then Database Import on the dropdown menu.
- On the import page, click Import from Self-Contained File and choose the
.sql
file you wish to import. Then, select your database as the Default Target Schema. - Click the Import Progress tab, then select Start Import.
- Allow the database to be uploaded and imported entirely. The time this takes can range from a few minutes, to several hours depending on the size of the database you're uploading and your internet speed.
# Importing a Database Backup via Command Line
This is an advanced method and MySQL Workbench essentially operates with a graphic interface, so we won't explain this in full. However, if you know how to run MySQL via command line, you can input your connection details into this command to import your .sql file: mysql -h YOURMYSQLHOST -u YOURDBNAME -p YOURDBNAME < YOURSQLFILE.sql
If you're looking for more MySQL guides, you can find them here.