How to migrate an existing NiDB installation to a new server
Sometimes you need to move your installation to a new server. Maybe you were testing in a virtual machine and want to move to a full server, or vice-versa. Maybe your server needs to be upgraded. Follow these steps to migrate an installation from one server to another.
On the old server, export the SQL database
mysqldump -uroot -ppassword nidb > nidb-backup.sql
Copy the exported .sql file to the new server.
On the new server, install NiDB as a new installation
On the new server, import the new database
mysql -uroot -ppassword nidb < nidb-backup.sql
Finish upgrade, by going to http://localhost/setup.php . Follow the instructions to continue the upgrade.
Detailed upgrade instructions
Get the most recent .rpm from github. The latest version may be different than the example below. You can also download the latest release .rpm from https://github.com/gbook/nidb/releases/latest
Visit http://localhost/setup.php and follow the pages.
Entry page - Turning off access to the website and disabling all modules can help prevent errors during the upgrade. Always remember to backup the database! Click Next to continue.
Pre-requisites - This page will check for CentOS packages and display an error if a package is missing or the wrong version. If missing any packages, check the output from the NiDB rpm installation or manually install the missing packages. After packages are installed, then refresh this page. Once all pre-requisities are met, click Next to continue.
SQL database connection Enter the root SQL password in this screen. If you want to check what tables will be updated, without updating them, select the Debug checkbox. If you encounter issues upgrading large tables, you can choose to limit the size of the tables that are upgraded and you can then update those manually. This is not recommended however. Click Configure Database to continue.
Schema upgrade The details of the schema upgrade will be displayed. Any errors will be indicated. Click Next to continue.
Configuration Any changes (paths, settings, options, etc) can be changed here. Click Write Config to continue.
All finished! Click Done to complete the upgrade.
The database schema upgrade may not display a SQL error if it occurs, but the errors are stored in the error_log
table in the database. Find the latest error(s) and the description will help diagnose the issue.
In phpMyAdmin, select the table in question. Under the operations tab, check the table type. If it is Innodb
, change this to Aria
, and click Go.
If the primary key error references a TEXT column, in other words if a TEXT column has a primary key, then delete the key for that column. This can be done in phpMyAdmin.
Download latest NiDB release.
yum --nogpgcheck localinstall nidb-xxxx.xx.xx-1.el8.x86_64.rpm
Make sure your IP address is set in the [setupips]
variable in the config file. This can be done manually by editing /nidb/nidb.cfg
or by going to Admin → Settings
Go to http://localhost/setup.php (Or within NiDB, go to Admin → Setup/upgrade)
Follow the instructions on the webpages to complete the upgrade
See upgrade instructions for a more in-depth explanation of the upgrade.