- Make sure
rcd-nodeca
installed & configured - Install tools if needed
sudo apt-get install build-essential software-properties-common
.
Install percona mysql server:
sudo apt-key adv --keyserver keys.gnupg.net --recv-keys 1C4CBDCDCD2EFD2A
echo "deb http://repo.percona.com/apt "$(lsb_release -sc)" main" | sudo tee /etc/apt/sources.list.d/percona.list
echo "deb-src http://repo.percona.com/apt "$(lsb_release -sc)" main" | sudo tee -a /etc/apt/sources.list.d/percona.list
sudo apt-get update
sudo apt-get install percona-server-server-5.6
Unpack:
mkdir /tmp/extract
lzop -d ./vzdump-openvz-101-*.tar.lzo -c | tar xv -C /tmp/extract
service mysql stop
# Check mysql does not run and kill if needed
ps ax | grep mysql
kill `cat /var/run/mysqld/mysqld.pid`
rm -rf /var/lib/mysql
cp -a /tmp/extract/var/lib/mysql /var/lib/mysql
chown mysql:mysql -Rv /var/lib/mysql
ln -s /tmp/extract/var/www/forum.rcdesign.ru/www /tmp/www
# Leave empty password field when asked, we reset it in next step
dpkg-reconfigure percona-server-server-5.6
Reset mysql permissions:
service mysql stop
mysqld_safe --skip-grant-tables &
echo "UPDATE mysql.user SET plugin = '' WHERE plugin = 'mysql_old_password'; FLUSH PRIVILEGES;" | mysql
kill `cat /var/run/mysqld/mysqld.pid`
mysqld_safe --skip-grant-tables &
echo "FLUSH PRIVILEGES; SET PASSWORD FOR 'root'@'localhost' = '';" | mysql
kill `cat /var/run/mysqld/mysqld.pid`
service mysql start
Drop old content (dev server only):
mongo nodeca --eval "printjson(db.dropDatabase())"
mongo nodeca-files --eval "printjson(db.dropDatabase())"
redis-cli -n 0 flushdb
Run CLI importer
./server.js migrate --all
./server.js vbconvert
Restore cached links/images data:
./bin/db-restore-cache nodeca ../dump_cache/nodeca
Start server:
start nodeca
service nginx start
- Vbconvert -> Import BBcode -> Blogs
- Vbconvert -> Import BBcode -> Club posts
- Vbconvert -> Import BBcode -> Messages
- Vbconvert -> Import BBcode -> Forum Posts
- Core -> Rebuild -> Forum: Posts
- Core -> Rebuild -> Forum: Topics
- Core -> Rebuild -> Clubs: Posts
- Core -> Rebuild -> Clubs: Topics
- Core -> Rebuild -> Messages
- Core -> Rebuild -> Blogs
- Core -> Rebuild -> External links
- Core -> Rebuild -> Images info
Rebuild, second pass (fix image sizes & video embeds)
- Core -> Rebuild -> Forum: Posts
- Core -> Rebuild -> Clubs: Posts
- Core -> Rebuild -> Messages
- Core -> Rebuild -> Blogs
Finalize:
- Core -> NNTP -> Rebuild all
- Core -> Dashboard -> Online
- Core -> Search -> Reindex
Dump caches (dev only):
./bin/db-dump-cache nodeca ../dump_cache