WebFaction
Community site: login faq

I need to move a Rails app from another host. I don't issue Unix commands very often, and always seem to do something wrong when I'm tar-ing and un-taring multiple directories. It would be a big help if someone could tell me which directory I should put the tar before I un-tar it -- to get it to unzip properly in my my_rails_app directory here -- and what command to use. Unfortunately I don't have ssh access at my old host so it's just going to tar my directory the way their Control Panel does it. Thanks very much.

asked 17 Aug '12, 18:48

phpdiva
1316
accept rate: 0%

edited 17 Aug '12, 18:58


To I'm not sure exactly how your other host's control panel makes its tar files, but doing this manually I would use something like this:

cd /path/to/original/rails
tar -czf backup.tar.gz --exclude=backup.tar.gz .

cd /path/to/destination/rails
tar -xzf backup.tar.gz

The first tar command creates a file called backup.tar.gz which contains all of the contents of the directory where it was created. Then, the second tar command extracts those files to the same directory where it is extracted.

If, instead, your control panel makes a tarball of a directory (more standard), you could just move all of the files out of that directory after extracting it. To include hidden files, use shopt -s dotglob:

tar -xzf backup_of_myrails_dir.tar.gz  # assume this a creates 'myrails' directory
shopt -s dotglob
mv ./myrails/* .

Hope that helps!

permanent link

answered 17 Aug '12, 20:12

ryans ♦♦
5.0k93460
accept rate: 43%

That did the trick, thanks!

(17 Aug '12, 20:22) phpdiva
Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×108
×16

question asked: 17 Aug '12, 18:48

question was seen: 1,711 times

last updated: 17 Aug '12, 20:22

WEBFACTION
REACH US
SUPPORT
AFFILIATE PROGRAM
LEGAL
© COPYRIGHT 2003-2020 SWARMA LIMITED - WEBFACTION IS A SERVICE OF SWARMA LIMITED
REGISTERED IN ENGLAND AND WALES 5729350 - VAT REGISTRATION NUMBER 877397162
5TH FLOOR, THE OLD VINYL FACTORY, HAYES, UB3 1HA, UNITED KINGDOM