Restore a nuBuilder Backup: Difference between revisions
[Added] Restore a nuBuilder Backup |
|||
(2 intermediate revisions by the same user not shown) | |||
Line 8: | Line 8: | ||
If a file named '''nubuilder4.sql''' already exists there, '''overwrite it'''. | If a file named '''nubuilder4.sql''' already exists there, '''overwrite it'''. | ||
== 3. Create the Target Database == | == 3. Create the Target Database (Optional) == | ||
This step is only required if the target database does not already exist. | |||
If the target database does not exist, create it using your preferred database management tool (e.g., phpMyAdmin or MySQL CLI). | If the target database does not exist, create it using your preferred database management tool (e.g., phpMyAdmin or MySQL CLI). | ||
== 4. Edit the Configuration File == | If you want to override an existing database, you should first truncate it (i.e., delete all tables and data) before importing the new backup. | ||
== 4. Edit the Configuration File (Optional) == | |||
This step is only required if you are importing into a new database. | |||
Open the '''nuconfig.php''' file and update the database configuration settings: | Open the '''nuconfig.php''' file and update the database configuration settings: | ||
Line 49: | Line 55: | ||
This method bypasses phpMyAdmin and is suitable for large files. | This method bypasses phpMyAdmin and is suitable for large files. | ||
== Option 4: | == Option 4: Utilise BigDump == | ||
BigDump is a staggered MySQL dump importer script that allows you to import large SQL files without timeout issues. | BigDump is a staggered MySQL dump importer script that allows you to import large SQL files without timeout issues. | ||
Latest revision as of 15:17, 28 May 2025
Importing a Backup in nuBuilder
1. Rename the Backup File
Before proceeding, rename your backup file to nubuilder4.sql.
2. Place the File in the Root Directory
Copy the renamed nubuilder4.sql file into the root directory of your nuBuilder installation. If a file named nubuilder4.sql already exists there, overwrite it.
3. Create the Target Database (Optional)
This step is only required if the target database does not already exist.
If the target database does not exist, create it using your preferred database management tool (e.g., phpMyAdmin or MySQL CLI).
If you want to override an existing database, you should first truncate it (i.e., delete all tables and data) before importing the new backup.
4. Edit the Configuration File (Optional)
This step is only required if you are importing into a new database.
Open the nuconfig.php file and update the database configuration settings:
- Database name
- Username
- Password
5. Automatic Import on First Login
When you log in to nuBuilder for the first time and the specified database is empty, nuBuilder will automatically import the contents of nubuilder4.sql into the database.
Other Options
Option 1: Compress the SQL File
Compress your `.sql` file using `gzip` to create a `.sql.gz` file. phpMyAdmin supports importing compressed files, which can help bypass upload size limitations.
Option 2: Increase PHP Configuration Limits
Edit your `php.ini` file to increase the following parameters:
upload_max_filesize = 2048M post_max_size = 2048M memory_limit = 2048M max_execution_time = 1800 max_input_time = 1800
After making these changes, restart your web server to apply the new settings.
Option 3: Use the MySQL Command Line
Import the database directly using the command line:
mysql -u your_username -p your_database < /path/to/yourfile.sql
Replace `your_username`, `your_database`, and `/path/to/yourfile.sql` with your actual MySQL username, database name, and the path to your SQL file. This method bypasses phpMyAdmin and is suitable for large files.
Option 4: Utilise BigDump
BigDump is a staggered MySQL dump importer script that allows you to import large SQL files without timeout issues.
- Download BigDump from its official website.
- Configure the script with your database credentials.
- Upload both the BigDump script and your SQL file to your server.
- Run the script via your web browser to import the database in segments.
Importing in Linux
To import the backup using a Linux terminal, follow these steps:
- Open a terminal.
- Navigate to the directory containing your `.sql` file:
cd /path/to/yourfile/
- Run the MySQL import command:
mysql -u your_username -p your_database < nubuilder4.sql
You will be prompted for your MySQL password. Once entered, the SQL file will be imported into the specified database.