Using a tar.gz file for site transfer?


#1

Hi all

I have a .tar.gz archive file that I created on my old webhost before it went down. I need to upload it now to dreamhost.com from my new account - but it’s unclear to me how to do that and make the file expand, etc, to restore my old site. Does anyone have experience with this?

Thanks in advance,

Jay


#2

The way you do this is to upload that tar.gz tarball up to your user space then log in to the shell via ssh and expand the file using the *nix tar command. I’m assuming you know how to ftp, as you have gotten this far, so I won’t address that further. :wink:

Read the Dreamhost Wiki Article of the shell, paying special attention to the included links to “enabling shell access”, to make sure that your user is authorized to access the shell.

Once you have connected to the shell, and can see your newly uploaded *.tar.gz file, you can “extract/expand” that file into you space with the “tar” command.

For more details on the use of tar, just type “man tar” and the tar user manual pages will be displayed.

Once your tarball is expanded, you may have to move some directories around, or rename some directories, depending upon the structure of your site on the other host, in order to have the files in the right place on DH ’ structure.

–rlparker


#3

Should be able to just:
ssh in and:
gzip -d backupexample.tar.gz
tar -xvf backupexample.tar

Save [color=#CC0000]$97[/color] on Dreamhost plans by using promo code: [color=#CC0000]SRVR97[/color]


#4

[quote]gzip -d backupexample.tar.gz
tar -xvf backupexample.tar[/quote]
Or just: tar xvzf backupexample.tar.gz

----------
[color=#00CC00]ANONYMOUS0 => Max Discount[/color], [color=#6600CC]ANONYMOUS2 => Max Discount less $1[/color] or Cut the code, [color=#CC0000]it’s their birthday:[/color] [color=#00CC00]9999 => $99.99 Off[/color]


#5

And just to show that I know something about it,
I’d tell you next time to use
bzip2 instead of .gz, because bzip compress better.
so :

compress:
tar cvyf file.tar.bz2 directory

extract
tar xvyf file.tar.bz2

The difference is y instead of z

Cupons:[color=#0000CC]MAO_HALFPRICE[/color] : pay only half of the price (L1 plans only) MAO97 get 97$ back


#6

I tried it, but got:

$ tar cvyf file.tar.bz2 *
tar: Warning: the -y option is not supported; perhaps you meant -j?

Yeah, so j instead of y.

Thanks for that suggestion though. Supposedly there is a large trade-off between file size and cpu time. So, bz2 could run into the process killer more…

And if you want “silent” tarring, leave out the ‘v’. :smiley:

What would pain me using bz2, I can see now, would be the extra keystrokes from using bzless file.bz2 instead of zless file.gz, which is already so much longer than less file. :wink:

----------
[color=#00CC00]ANONYMOUS0 => Max Discount[/color], [color=#6600CC]ANONYMOUS2 => Max Discount less $1[/color] or Cut the code, [color=#CC0000]it’s their birthday:[/color] [color=#00CC00]9999 => $99.99 Off[/color]


#7

:slight_smile:

btw…change your signature… 9999 doesn’t work anymore :slight_smile:

Cupons:[color=#0000CC]MAO_HALFPRICE[/color] : pay only half of the price (L1 plans only) MAO97 get 97$ back


#8

I have the same problem as rla, but I’m confused about “the shell” and that help article didn’t help either. Where is “the shell”? How do I use “the shell”?


#9

Ok. You are speaking about the shell as something mystical (uuh “the shell”)…wich in fact is. :slight_smile:
A shell is a place where you can write command to be executed. If you are running windows, a shell is like a command prompt. (Start/All Programs/Accessories/Command Prompt). On a shell you can see your files with the command “ls” (short for “list”), you can change directory with the command “cd” (short for "change directory) …etc…

To use the shell you need to activate it first. Panel->Users->Manage Users->and select Edit. You will see the possibilty to activate the shell. After that you should wait for an email with some more explanation.

That email doesn’t explain everything, so I’ll tell you what you should do.
First you need a program to access shell easily and in a comfortable way.Windows gives you a way to do that but it’s not good enough. Almost everyone likes to use PuTTY.
(http://www.chiark.greenend.org.uk/~sgtatham/putty/)
Download that program and start it. It will open a window; for now just put your hostname where it says “Hostname”.
If you press Open, you should see a new window appear with something kind of code on it, asking if you accept the crypted connection. Say yes.
A black window will appear then, asking for your username, write it (you should have it written on the email ) and press enter. Then it will ask for the password. Write it and press enter.
Now you are on a shell.
I usually suggest here to write “csh” and press enter.
then try with:
ls
ls -l
cd yourhostname.com
ls -l
ls -a
cd
explanation: ls -l means ls long, where you can see more information about your files.
cd yourhostname.com (where yourhostname.com) will change the directory you are seeing. later when you write cd alone, the shell will go back to the starting directory.
ls -a shows hidden files (files starting with a dot.) This is useful done inside your domain’s directory because you will see .htaccess files (if created).

I hope this is clear enough. feel free to ask again. Don’t worry about feeling dumb. I usually ask dumber question.

Cupons:[color=#0000CC]MAO_HALFPRICE[/color] : pay only half of the price (L1 plans only) MAO97 get 97$ back


#10

[quote]9999 doesn’t work anymore :slight_smile:

[/quote]

What makes you say that? Last I heard it works sometimes.

----------
[color=#00CC00]ANONYMOUS0 => Max Discount[/color], [color=#6600CC]ANONYMOUS2 => Max Discount less $1[/color] or Cut the code, [color=#CC0000]it’s their birthday:[/color] [color=#00CC00]9999 => $99.99 Off[/color]


#11

[quote]Ok. You are speaking about the shell as something mystical (uuh “the shell”)…wich in fact is. :slight_smile:

[/quote]

It surrounds the kernel, after all. :slight_smile:

Isn’t your post’s explanation in the links from the wiki link above? If not, could you update the wiki? :cool:

----------
[color=#00CC00]ANONYMOUS0 => Max Discount[/color], [color=#6600CC]ANONYMOUS2 => Max Discount less $1[/color] or Cut the code, [color=#CC0000]it’s their birthday:[/color] [color=#00CC00]9999 => $99.99 Off[/color]


#12

the shell page explain what a shell is in a “wikipedia” style wich could be difficult to understand.

I’ll probably add my text surrounded by something like:

“mao, on our forum tried to explain what a shell is with this post:” …and then I’ll copy my post there.

What do you think?
(I’ll link my name to my site, just to have a href to my site :slight_smile:

Cupons:[color=#0000CC]MAO_HALFPRICE[/color] : pay only half of the price (L1 plans only) MAO97 get 97$ back


#13

sometimes?

Well I tried it when I purchased my hosting plan (23rd of feb)
and it didn’t worked.

Cupons:[color=#0000CC]MAO_HALFPRICE[/color] : pay only half of the price (L1 plans only) MAO97 get 97$ back


#14

[quote](I’ll link my name to my site, just to have a href to my site :slight_smile:

[/quote]

I think the powers that be won’t allow that, unless they don’t notice. :cool:

[quote]sometimes?

[/quote]

It’s a real Special Sale! by dreamhost. Sometimes it works, sometimes it doesn’t. Unless they turned it off completely, without telling me.

----------
[color=#00CC00]ANONYMOUS0 => Max Discount[/color], [color=#6600CC]ANONYMOUS2 => Max Discount less $1[/color] or Cut the code, [color=#CC0000]it’s their birthday:[/color] [color=#00CC00]9999 => $99.99 Off[/color]


#15

OH. then I should have tried for the whole week instead of registering just before the big shutdown…
:slight_smile:

Cupons:[color=#0000CC]MAO_HALFPRICE[/color] : pay only half of the price (L1 plans only) MAO97 get 97$ back


#16

I’m in the putty shell and have tried extracting the tar using “tar -xf mybackupname.tar.gz” but get the following:

[mrpibb]$ tar -xf mybackupfile.tar.gz
tar: This does not look like a tar archive
tar: Skipping to next header
tar: Archive contains obsolescent base-64 headers
tar: Read 7006 bytes from mybackupfile.tar.gz
tar: Error exit delayed from previous errors

now I’ll be realllly pissed if the file they sent me was corrupt - but is there any other explanation? how do I verify?

When I ran the command one user suggested in a post above, it went through a lengthy process of showing me all of the directories within my archive, but I’m not sure if it expanded it or anything, because it appears that no files were created.


#17

Yes, I used tar xzvf xname.tar.gz

It listed all of my directories (i believe) and when it stopped, it seemed it had worked - but no extracted files or directories have appeared.

When I use the tar -t command to “list” all of the files, it just seems to halt my progress in the shell indefinitely. i lose the {mrpibb} header/prompt (whatever it’s called!)

And of course, I receive this if I run tar -xf alone. Is that not normal?:

tar: This does not look like a tar archive
tar: Skipping to next header
tar: Archive contains obsolescent base-64 headers
tar: Read 7006 bytes from xname.tar.gz
tar: Error exit delayed from previous errors


#18

“This does not look like a tar archive”

Well don’t be pissed - just be ashamed that you didn’t realize the file is a compressed file, hence the .gz extension. When you uncompress it, then you have a tar file.

And yeah it should have been tar -xzf mybackupfile.tar.gz - the z causes tar to use gzip to uncompress the file first.

:cool: [color=#6600CC]Atropos[/color] | openvein.org


#19

lol - ok that makes sense… now if only that corrected command would work!


#20

Don’t forget to use a “nice” before that command to try to convince the process killer not to kill your extract.

You may even want to do it in two parts, uncompress an then tar.

Wholly - Use promo code WhollyMindless for full 97$ credit. Let me know if you want something else!