Diferència entre revisions de la pàgina «CMS backup and restoring»
		
		
		
		
		
		
		Salta a la navegació
		Salta a la cerca
		
				
		
		
		
		
		
		
		
	
 (Es crea la pàgina amb «To backup and restore a CMS we have to follow the following procedure: # Export database and filesystem of the original CMS. # Import files and database in the new system…».)  | 
				|||
| Línia 24: | Línia 24: | ||
#: <pre>mysql> create database enric_newdb;</pre>  | #: <pre>mysql> create database enric_newdb;</pre>  | ||
#* Using phpmyadmin  | #* Using phpmyadmin  | ||
| − | # Import the   | + | # Import the SQL file in the new database.  | 
#* Using ''mysql'' command:<pre>$ mysql -u enric -p enric_newdb < cmsdb.sql</pre>  | #* Using ''mysql'' command:<pre>$ mysql -u enric -p enric_newdb < cmsdb.sql</pre>  | ||
#* Using phpmyadmin  | #* Using phpmyadmin  | ||
| − | |||
| − | |||
=== Adjusting config files of the new CMS ===  | === Adjusting config files of the new CMS ===  | ||
Revisió del 19:37, 26 març 2011
To backup and restore a CMS we have to follow the following procedure:
- Export database and filesystem of the original CMS.
 - Import files and database in the new system.
 - Adjust the config files of the CMS to make it work.
 
Contingut
Export your original CMS
- Backup files in the source CMS (with tar, zip, etc.).
- Our suggestion is to use the command: 
$ tar cvfz cmsfoldername.tar.gz cmsfoldername
(obviously changing cmsfoldername for your CMS folder name). 
 - Our suggestion is to use the command: 
 - Export database with mysqldump (in a *.sql file). We can use:
- Command mysqldump. With:
$ mysqldump -u enric -p cmsdbname > cmsdb.sql
We will create the file cmsdb.sql with all CMS DB data. Obsioulsy you have to change "enric" for your user name. - phpmyadmin: too easy to give explanations for that.
 
 - Command mysqldump. With:
 
That should result in having 2 files, (1) *.tar.gz and (2) *.sql.
Importing in the new system
We need 2 files: the tarball and the sql for database.
- Copy the files (*.sql and *.tar.gz) to your target system.
 - Extract files in the target system.
- Using tar the command is:
$ tar xvfz cmsfoldername.tar.gz
 
 - Using tar the command is:
 - Create the database in the target system.
- Using mysqladmin command:
$ mysqladmin -u enric -p create enric_newdb
(Obviously changing enric for your username). - Using mysql command:
$ mysql -u enric -p
 
mysql> create database enric_newdb;
- Using phpmyadmin
 
 - Using mysqladmin command:
 - Import the SQL file in the new database.
- Using mysql command:
$ mysql -u enric -p enric_newdb < cmsdb.sql
 - Using phpmyadmin
 
 - Using mysql command:
 
Adjusting config files of the new CMS
...
More
To know more you can read that articles for database creation, export and import:
- SQL exportacio: DB export.
 - SQL creacio: creation and import of databases.