Here is a short guide on howto migrate phpipam to new server. Before migrating please make sure both (old and new) servers have the same phpipam code (version).
For this example we will use following assumptions, please adjust accordingly:
- phpipam code will be in
/var/www/phpipam
directory - phpipam database name will be
phpipam
- MySQL username and password for phpipam will be
phpipam / phpipampassword
1.) Export phpipam database and save config file
To start with migration we first need to make a copy of phpipam database and config.php file containg basic phpipam configuration. To export database we will use mysqldump:
[root@ipam_old /]# mysqldump phpipam -u phpipam -p > /tmp/phpipam_migration_database.sql Enter password: [root@ipam_old /]# cp /var/www/phpipam/config.php /tmp/phpipam_migration_config.phpWe created two files in /tmp/ directory: phpipam_migration_database.sql containg MySQL dump and copy of config.php file named phpipam_migration_config.php. Copy those two files to new server, for exampe we will also copy it to /tmp/ directory via rsync :
[root@ipam_old /]# rsync -v /tmp/phpipam_migration_* ipam_new:/tmp/ sending incremental file list phpipam_migration_config.php phpipam_migration_database.sql sent 41,680 bytes received 35 bytes 83,430.00 bytes/sec total size is 41,581 speedup is 1.00
2.) Import MySQL database to new server
On new server we first need to create database and grant user permissions before we can import MySQL data. For this we need user with permissions to create database and manage grants, for example we will use root account:
[root@ipam_new /]# mysql -u root -p Enter password: Welcome to the MySQL monitor. Commands end with ; or \g. mysql> create database phpipam; Query OK, 1 row affected (0.00 sec) mysql> grant ALL on `phpipam`.* to 'phpipam'@'127.0.0.1' identified by "phpipampassword"; Query OK, 0 rows affected (0.00 sec) mysql> mysql> grant ALL on `phpipam`.* to 'phpipam'@'localhost' identified by "phpipampassword"; Query OK, 0 rows affected (0.00 sec) mysql> mysql> flush privileges; Query OK, 0 rows affected (0.00 sec) mysql> quit ByeNow that database and permissions are created we can import data from old server:
[root@ipam_new /]# mysql -u phpipam -p phpipam < /tmp/phpipam_migration.sql Enter password:
3.) Download phpipam code and restore config.php
Database is set, what remains is fetching phpipam code and restoring config file. To download phpipam code use this guide. After code is in place simple copy old config file:
[root@ipam_new /]# cp /tmp/phpipam_migration_config.php /var/www/phpipam/config.php
This should be it ! In case you have prettylinks enabled make sure url_rewrite is working on new server also !