Dan Newcome, blog

I'm bringing cyber back

Migrating between Linux virtual hosting services

with one comment

I’ve been shuffling my sites around lately, canceling some virtual machines that I don’t use much and consolidating sites that get less traffic onto cheaper hosting. I’m mostly using Apache and MySql on these sites along with Node.js. I’m looking at moving to Nginx in front of the Node.js sites though.

Anyway, most of the work here is moving what is in the web content directories and my MySql database directories.

 

$ sudo service mysql stop
$ tar cf ~/mysql-bak.tar /var/lib/mysql
$ tar cf ~/www-bak.tar /var/www
$ tar cf ~/apache-config.tar apache2

On the new server we need at least MySql and Apache

# sudo apt-get install mysql-server
# sudo apt-get install apache2

I was able to copy my previous Apache configuration over from the old server and reuse it. I copied the symlinks for sites-enabled and mods-enabled, which was pretty nice.

I used to install node.js from source, but this time around I installed from apt. I figure Node is more stable now, so I’ll give it a shot. Same with NPM.

# apt-get install nodejs
# apt-get install npm

I had to symlink the nodejs binary in order to get it working with forever:

# ln -s /usr/bin/nodejs /usr/bin/node

However forever still isn’t working for me. It’s looking for daemon.js, which I installed using npm.

Error: Cannot find module './daemon.v0.6.19'

I had to grant all privileges on my MySql databases instead of just CRUD stuff like I used to. I’m not sure why this is yet.

All in all, moving a Linux VPS isn’t too bad if you can reuse most of the configuration. More on this later.

Advertisements

Written by newcome

March 1, 2013 at 1:27 am

Posted in Uncategorized

One Response

Subscribe to comments with RSS.

  1. I’d need to test with you here. Which isn’t one thing I usually do! I take pleasure in studying a put up that may make people think. Additionally, thanks for permitting me to remark!

    Linux tutorials

    April 9, 2013 at 9:34 am


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: