如何备份和恢复?
1,备份
假设在wordpress服务器上面的安装路径是/var/www/html/wordpress,备份的目录为/home/quietheart/backup_wordpress。
1)备份wordpress相关内容:
备份网站服务器上wordpress安装目录的"wp-content"子目录内容,以及"wp-config.php"文件内容,和其它你所修改的内容(如果有的话)。其中"wp-content"子目录包含插件以及上传的附件等;wp-config.php中的内容是一些配置信息。
过程如下:
#cd /var/www/html/wordpress
#tar -czvf wp-content.tgz wp-content
#mv wp-content.tgz /home/quietheart/backup_wordpress
#cp wp-config.php /home/quietheart/backup_wordpress
2)备份wordpress数据库内容:
备份的数据库的名字不要忘记,在wp-config.php中也能找到。
两种方法:
第一种使用插件:"WordPress Database Backup",直接生成备份好的数据库。
第二种使用mysql命令:(待实践)
过程如下:
综上可知,备份的内容主要有:1)wp-content目录的压缩包。2)wordpress数据库。3)修改的文件如wp-config.php。
2,恢复
假设在另外一台主机上面恢复之前备份的wordpress程序,安装路径为/var/www/html/wordpress,
需要恢复的数据的备份路径为:/home/quietheart/backup_wordpress
大致过程如下:
1)下载你所备份的同样版本的wordpress程序。
下载网址一般在www.wordpress.org能找到。
2)解压下载的wordpress拷贝到网络目录中,将之前备份的wp-content拷贝进去
3)创建一个和备份数据库同样名称的空数据库。
4)安装wordpress
5)导入备份数据库
下面给出具体的过程:
#cd /home/quietheart/tmpTrans
#wget http://wordpress.org/latest.tar.gz
#tar -xzvf latest.tar.gz
#mv wordpress /var/www/html/
#mysql --default-character-set=utf8 -uquietheart -p quietheart<quietheart_wp_20110626_137.sql
注意:如果不用"--default-character-set=utf8"选项会出现乱码。
问题:分类目录中的链接跳转的有些问题。
1,备份
假设在wordpress服务器上面的安装路径是/var/www/html/wordpress,备份的目录为/home/quietheart/backup_wordpress。
1)备份wordpress相关内容:
备份网站服务器上wordpress安装目录的"wp-content"子目录内容,以及"wp-config.php"文件内容,和其它你所修改的内容(如果有的话)。其中"wp-content"子目录包含插件以及上传的附件等;wp-config.php中的内容是一些配置信息。
过程如下:
#cd /var/www/html/wordpress
#tar -czvf wp-content.tgz wp-content
#mv wp-content.tgz /home/quietheart/backup_wordpress
#cp wp-config.php /home/quietheart/backup_wordpress
2)备份wordpress数据库内容:
备份的数据库的名字不要忘记,在wp-config.php中也能找到。
两种方法:
第一种使用插件:"WordPress Database Backup",直接生成备份好的数据库。
第二种使用mysql命令:(待实践)
过程如下:
综上可知,备份的内容主要有:1)wp-content目录的压缩包。2)wordpress数据库。3)修改的文件如wp-config.php。
2,恢复
假设在另外一台主机上面恢复之前备份的wordpress程序,安装路径为/var/www/html/wordpress,
需要恢复的数据的备份路径为:/home/quietheart/backup_wordpress
大致过程如下:
1)下载你所备份的同样版本的wordpress程序。
下载网址一般在www.wordpress.org能找到。
2)解压下载的wordpress拷贝到网络目录中,将之前备份的wp-content拷贝进去
3)创建一个和备份数据库同样名称的空数据库。
4)安装wordpress
5)导入备份数据库
下面给出具体的过程:
#cd /home/quietheart/tmpTrans
#wget http://wordpress.org/latest.tar.gz
#tar -xzvf latest.tar.gz
#mv wordpress /var/www/html/
#mysql --default-character-set=utf8 -uquietheart -p quietheart<quietheart_wp_20110626_137.sql
注意:如果不用"--default-character-set=utf8"选项会出现乱码。
问题:分类目录中的链接跳转的有些问题。