WordPress関連データの復元
PCに保存のバックアップデータをサーバにアップロード WinSCPを使用
PCに保存していたバックアップファイルをRaspberry Pi4にアップロードします。(/home/takasanへ)
データベース:backup.dmp
HTML :html.tar.tgz
HTMLの復元
takasan@web1:~ $ cd /var/www/html
takasan@web1:/var/www/html $ ls
index.html
takasan@web1:/var/www/html $ sudo rm index.html
takasan@web1:/var/www/html $ sudo tar xzvf ~/html.tar.tgz
takasan@web1:/var/www/html $ sudo chown -R www-data:www-data /var/www/html/
データベースの復元
takasan@web1:~ $ sudo mysql -uroot -p(rootのパスワード) < ~/backup.dmp
takasan@web1:~ $ sudo mysql -uroot -p
Enter password:
<<省略>>
MariaDB [(none)]> CREATE USER 'Wordpress用DBのユーザー名'@localhost IDENTIFIED BY '同ユーザーのパスワード';
Query OK, 0 rows affected (0.004 sec)
MariaDB [(none)]> GRANT ALL PRIVILEGES ON *.* to WordPress用DBのユーザー名@localhost;
Query OK, 0 rows affected (0.008 sec)
MariaDB [(none)]> exit
Bye
Webページの復元
Webページ(ブログ)、WordPressのログインページにアクセスした。
・Webページ:http://web1.tfujiwara.work
Debian LogoApache2 Debian Default Page の表示。
・WordPressのログインページ:http://tfujiwara.work/wp-login.php
接続不可。
WordPressの復活は失敗!!