This manual is deprecated. Please visit https://groupoffice.readthedocs.io for the latest documentation.

Difference between revisions of "Moving or backup an installation"

From Group-Office Groupware and CRM Documentation
Jump to: navigation, search
(New page: To move Group-Office to another location move all files and the database into the new folder. Note: All the directories here are examples. They are probably different in your case. Packin...)
 
 
(12 intermediate revisions by 2 users not shown)
Line 1: Line 1:
To move Group-Office to another location move all files and the database into the new folder.
+
To move Group-Office to another server you need to backup all data files and the database.
  
Note: All the directories here are examples. They are probably different in your case.
+
Note: All the directories here are examples. They are probably different in your case.  
Packing up files at the old server
+
  
Create an archive of the Group-Office files:
+
Determine where the data files are stored (You can also just open config.php and lookup the value instead of using 'cat' and 'grep' on linux):
<pre>$ tar czf groupoffice-scripts.tar.gz /var/www/groupoffice</pre>
+
  
Now determine where user files are stored:
+
<pre>$ cat /etc/groupoffice/config.php | grep file_storage_path
 
+
<pre>$ cat /var/www/groupoffice/config.php | grep local_path
+
$config['local_path']='/var/www/go-local/';</pre>
+
 
+
And the same goes for these files:
+
 
+
<pre>$ cat config.php | grep file_storage_path
+
 
$config['file_storage_path']='/home/groupoffice/';</pre>
 
$config['file_storage_path']='/home/groupoffice/';</pre>
  
Now create archives of these paths (It might be that the local path is inside the Group-Office scripts directory. In that case you can skip the creation of the local archive):
+
Now create an archive of this path:
 
+
 
   
 
   
<pre>$ tar czf groupoffice-local.tar.gz /var/www/go-local
+
<pre>$ tar czf groupoffice-files.tar.gz /home/groupoffice</pre>  
$ tar czf groupoffice-files.tar.gz /home/groupoffice</pre>
+
  
+
This command outputs the database parameters (You can also just open config.php and lookup the values instead of using 'cat' and 'grep' on linux):  
 
+
This command outputs the database parameters:  
+
  
 
<pre>$ cat config.php | grep db
 
<pre>$ cat config.php | grep db
Line 36: Line 23:
  
 
Now create a dump of the database:  
 
Now create a dump of the database:  
<pre>$ mysqldump groupoffice -u groupoffice -p > groupoffice-20070813.sql</pre>
+
<pre>$ mysqldump --default-character-set=utf8 groupoffice -u groupoffice -p > groupoffice-20070813.sql</pre>
  
You might want to tar this file up to save bandwidth:  
+
You might want to compress this file to save bandwidth:  
 
<pre>$ tar czf groupoffice-database.tar.gz groupoffice-20070813.sql</pre>
 
<pre>$ tar czf groupoffice-database.tar.gz groupoffice-20070813.sql</pre>
  
Now we packed up all nessecary files in archives:
+
Now we've packed up all necessary files in archives:
  
# groupoffice-scripts.tar.gz
 
 
# groupoffice-files.tar.gz
 
# groupoffice-files.tar.gz
# groupoffice-local.tar.gz
 
 
# groupoffice-database.tar.gz
 
# groupoffice-database.tar.gz
  
Important: If you are going to hand over these files to another person to complete the migration on another server, make sure you mention the old file_storage_path. It's necessary to move the filesystem shares!
+
==Installing the backup on the new server==
Installing the old files on the new server
+
  
Unpack the scripts, files and local archive in the new location:
+
First [[Installation manual|install the Debian packages or follow the manual installation]] for Group-Office.
  
<pre>$ cd /var/www/groupoffice
+
Then replace the Group-Office files and database with your backups. It's probably useful to install PhpMyAdmin so you can empty the default "groupoffice-com" database on Debian easily.
$ tar zxf groupoffice-scripts.tar.gz
+
 
+
$ cd /home/groupoffice
+
$ tar zxf groupoffice-files.tar.gz
+
 
+
$ cd /var/www/go-local
+
$ tar zxf groupoffice-local.tar.gz
+
</pre>
+
 
+
Create a new database for Group-Office:
+
<pre>$ mysql -u root -p
+
mysql> CREATE DATABASE groupoffice;
+
mysql> GRANT ALL PRIVILEGES ON groupoffice.* TO 'groupoffice'@'localhost'
+
-> IDENTIFIED BY 'some_pass' WITH GRANT OPTION;</pre>
+
 
+
If the filesystem paths of the files are different then you need to perform two queries on the database to preserve the file permissions and links:
+
 
+
<pre>mysql> UPDATE fs_links SET path=replace(path, '/old/file_storage_path/','/new/file_storage_path/');
+
mysql> UPDATE fs_shares SET path=replace(path, '/old/file_storage_path/','/new/file_storage_path/');</pre>
+
 
+
Now we are done with mysql:
+
+
<pre>mysql> quit;</pre>
+
 
+
If you don't know the old file_storage_path you can get it from the old config file:
+
 
+
<pre>$ cat config.php | grep file_storage_path
+
$config['file_storage_path']='/home/groupoffice/';</pre>
+
  
Now you need to run http://some_url_to_groupoffice.com/install/install.php and follow instructions to complete the install.
+
Now you need to run http://some_url_to_groupoffice.com/install/ and follow instructions to complete the install.
  
 
Good luck!
 
Good luck!

Latest revision as of 08:14, 30 July 2013

To move Group-Office to another server you need to backup all data files and the database.

Note: All the directories here are examples. They are probably different in your case.

Determine where the data files are stored (You can also just open config.php and lookup the value instead of using 'cat' and 'grep' on linux):

$ cat /etc/groupoffice/config.php | grep file_storage_path
$config['file_storage_path']='/home/groupoffice/';

Now create an archive of this path:

$ tar czf groupoffice-files.tar.gz /home/groupoffice

This command outputs the database parameters (You can also just open config.php and lookup the values instead of using 'cat' and 'grep' on linux):

$ cat config.php | grep db

$config['db_type']='mysql';
$config['db_host']='localhost';
$config['db_name']='groupoffice';
$config['db_user']='groupoffice';
$config['db_pass']='password';

Now create a dump of the database:

$ mysqldump --default-character-set=utf8 groupoffice -u groupoffice -p > groupoffice-20070813.sql

You might want to compress this file to save bandwidth:

$ tar czf groupoffice-database.tar.gz groupoffice-20070813.sql

Now we've packed up all necessary files in archives:

  1. groupoffice-files.tar.gz
  2. groupoffice-database.tar.gz

Installing the backup on the new server

First install the Debian packages or follow the manual installation for Group-Office.

Then replace the Group-Office files and database with your backups. It's probably useful to install PhpMyAdmin so you can empty the default "groupoffice-com" database on Debian easily.

Now you need to run http://some_url_to_groupoffice.com/install/ and follow instructions to complete the install.

Good luck!