WordPressによるホームページ制作のCB-Web(シービーウェブ)

Memos 制作メモ

CB-Webホーム > 制作メモ > wordpress 引越し

wordpress 引越し,2020.10.17更新

at www.hogehoge.com

mysqldump -u root -p hogehoge > dump_hogehoge.sql
tar -zcf wp_plugins2020xxxx.tar.gz -C [hogehoge's docroot]/wp-content plugins
tar -zcf wp_uploads2020xxxx.tar.gz -C [hogehoge's docroot]/wp-content uploads
tar -zcf wp_hogetheme2020xxxx.tar.gz -C [hogehoge's docroot]/wp-content/themes/ hogetheme
cp [hogehoge's docroot]/wp-content/wp-config.php ./

 

at www2.hogehoge.com

su
mysql -u root -p
  create database hogehoge;
  create user 'hogehoge'@'localhost' identified by 'hogepass';
  grant all on hogehoge.* to 'hogehoge'@'localhost';
  use hogehoge;
  update wp_options set option_value='http://www2.hogehoge.com' where option_name='siteurl';
  update wp_options set option_value='http://www2.hogehoge.com' where option_name='home';
  update wp_2_options set option_value='http://www2.hogehoge.com' where option_name='siteurl'; /* multi-site only */
  update wp_2_options set option_value='http://www2.hogehoge.com' where option_name='home'; /* multi-site only */
  update wp_blogs set domain='www2.hogehoge.com'; /* multi-site only */
  exit;
cd [docroot]
wget https://ja.wordpress.org/latest-ja.tar.gz
tar -xf latest-ja.tar.gz
(rm latest-ja.tar.gz)
mv wordpress hogehoge
tar -xf wp_plugins2020xxxx.tar.gz -C hogehoge/wp-content/
tar -xf wp_uploads2020xxxx.tar.gz -C hogehoge/wp-content/
tar -xf wp_hogetheme2020xxxx.tar.gz -C hogehoge/wp-content/themes/
cp wp-config.php hogehoge/
vi hogehoge/wp-config.php
  :%s/www¥.hogehoge¥.com/www2¥.hogehoge¥.com/g
  :q
chown -R hogeown hogehoge
chgrp -R hogegrp hogehoge
chmod -R 775 hogehoge
( Access wp-admin and confirm permalink's setting in all sites( for multi-site, confirm at wp-admin/network page. ). )

( It probably get finished. )

 

× CLOSE