Change File / Folder Owner With SSH

After doing a transfer of files for a website using SSH, if you’ve transferred from one domain to another, you’ll probably run into a file or folder ownership problem. Using SSH, this is actually easy to fix.

Log in to your server using SSH

Change to the directory you need to change permissions or ownership.

chown -R correctuser *

correctuser is the name of the owner of this website

That’s it. You’ve now changed the owner of files and folders in that directory using SSH.

Another Way to Move Website Via SSH

Very recently, we published an article about moving entire website from one server to another via SSH. Sometimes those commands give us problems with the resulting transfer, so we found this alternate method that seems to work perfectly.

Keep in mind, you MUST perform separate actions for copying or moving databases as well as adding email addresses.

1. First log in to your old server via SSH. If necessary, you may need to login as a “super user”.

2. Change directories to the directory where your website resides.

3. Type in the following code:

4. tar -cpzf backup.tar.gz *

6. This creates a tar file of all files in that directory.

7. Login to your new server.

8. Navigate to the directory where you want to place the website you are moving.

7. Type in:

8. wget yourdomain.com/backup.tar.gz

9. (Of course, yourdomain.com is replaced with your actual domain name). This transfers the tar file from the old server to the new server.

10. Once the file is transfered, type:

10. tar -xzf backup.tar.gz

11. This will unpack the tar file onto the new server in the directory that you placed it.

That’s it, another way to move websites using SSH.

How To Move A Website From One Server To Another Using SSH

If you ever have the need to move or migrate complete websites from one server to another, you know what a hassle it is using FTP. For one, it takes a long time, especially for larger sites, plus most of the time, we lose connection and our FTP program stalls, meaning we have to start all over again. So here’s how to do it using SSH /Telnet.

  1. First log in to your old server via SSH. If necessary, you may need to login as a “super user”.
  2. Change directories to the directory where your website resides.
  3. Type in the following code:
  4. tar -cvf sitepack.tar ./ This creates a tar file of all files in that directory.
  5. Login to your new server.
  6. Navigate to the directory where you want to place the website you are moving.
  7. Type in:
  8. wget yourdomain.com/sitepack.tar (Of course, yourdomain.com is replaced with your actual domain name). This transfers the tar file from the old server to the new server.
  9. Type:
  10. tar -xvf sitepack.tar
  11. This will unpack the tar file onto the new server in the directory that you placed it.

There you go. Within seconds you have moved all your site files from one server to another using SSH, which makes migrating a website as easy as ever.

Keep in mind, you MUST perform separate actions for copying or moving databases as well as adding email addresses.

Alternate or Different Backgrounds Using CSS

Ever want to have different backgrounds for different pages? Here’s the way we suggest:

Using your <body> tag on your hrml page, add an id tag. Now it might look like this:

<body id=”page_2″>

In your CSS file, add

.body#page_2 {

your parameters and settings

}

Thats it!