Backup:
- Log in to your cPanel account using your username and password.
- Navigate to the "Files" or "Files Manager" section in cPanel.
- Locate and open the "/app" directory where your phpListings installation is located.
- Find the configuration file named "/app/Config/Db.php". Right-click on the file and select "Download" to save a copy of it to your local computer. This file contains the database connection information that you will need when restoring your database.
- Go back to the cPanel home screen and find the "Databases" section. Click on "phpMyAdmin".
- In phpMyAdmin, you will see a list of databases on the left-hand side. Locate the database associated with your phpListings installation.
- Once you have selected the correct database, click on the "Export" tab in the top navigation menu.
- On the export page, ensure that all tables are selected and the export method is set to "Quick" or "Custom" (either option should work fine for most cases). Leave the format as "SQL."
- Scroll down and click on the "Go" or "Export" button to start the database export process. This will generate a SQL file containing the database structure and data.
- Save the exported SQL file to your local computer. Choose a location and name for the file that makes it easy to identify and restore later. This file serves as the backup of your phpListings database.
Restore:
- Ensure that the backup is of the correct phpListings version.
- Log in to your cPanel account using your username and password.
- Navigate to the "Files" or "Files Manager" section in cPanel.
- Locate and open the "/app" directory where your phpListings installation is located.
- Upload the previously saved "/app/Config/Db.php" file from your local computer to this directory, replacing the existing file. This step ensures that your phpListings installation connects to the correct database during the restore process.
- Go back to the cPanel home screen and find the "Databases" section. Click on "phpMyAdmin".
- In phpMyAdmin, locate the database where you want to restore the backup.
- Select the database in phpMyAdmin, select all tables of that database with the "Check All" checkbox at the bottom of the page, and choose the "Drop" option in the "With Selected:" dropdown. This will remove all existing tables of the database.
- Click on the "Import" tab in the top navigation menu.
- On the import page, click on the "Browse" or "Choose File" button and locate the SQL backup file you want to restore from your local computer.
- Ensure that the "SQL" format is selected and click on the "Go" or "Import" button to start the database restore process. This may take a few moments depending on the size of the backup file.
- Once the import process completes, you will see a success message indicating that the database has been restored.
At this point, you have successfully backed up and restored your phpListings MySQL database using cPanel. Make sure to test your phpListings installation to ensure that the restored data is functioning correctly.
Thank you.