Announcement

Collapse
No announcement yet.

Moving server -> tar-commando's

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Moving server -> tar-commando's

    I'm planning to move my server ASAP from pair to site5 and want to tar my old site with permissions and all that's in need to limit the work I have to do to make it work again...

    Anyone who can give me the tar-commands to tar the whole bunch (with permissions and directory structure etc) and the commands to untar it again?

    Thanks in advance

  • #2
    tar cvf file.tar dir/file

    gzip file.tar

    you can use tar cvfo - the o is supposed to, according to the manpage, retain Ownership info. However, manpage also states that this is default for any user other than root, which I assume you are not.

    to restore,

    gunzip file.tar.gz

    tar xvf file.tar

    Comment


    • #3
      Thanks, I allready found it out...You may wanna use the p option too...the permissions are included then:

      tar -cpPvzf bla.tar.gz /www

      untar:

      tar --same-permissions -xvzf bla.tar.gz

      Comment


      • #4
        Note from Site5

        Hi there!

        Just a tip... if you can get your mySQL databases tarred up (the actual directories - usually located at in /var/lib/mysql/databasename), we would be happy to untar them on our servers and add them to your account. This saves you the trouble of trying to copy databases over.

        have your host do the following:
        tar -C /var/lib/mysql -zcf /your/doc/root/databasename.tar.gz databasename

        If you are able to get these tarred up, simply upload them to your account and drop our tech support a line, we will do the rest.

        We're looking forward to working with you!


        Best Regards,
        Matt Lightner
        Site5 Tech Support
        [email protected]


        -------<added to post>-------

        I should also note that the mysqldump method will also work fine for movnig your data. Use the syntax below:

        On old server:
        mysqldump -p -u[db_username] [databasename] > databasename.txt

        On Site5 servers:
        mysql -p -u[db_username] [databasename] < database.txt



        [Edited by MattLight on 07-25-2000 at 02:18 AM]

        Comment


        • #5
          hi ya Matt... you probably don't remember me eva2000 from your site5 UBB forum a while back - the planned entertainment network guy who you referred me to a colocation provider ?

          well i am on my own dedicated red hat linux server now - so are the above tar commands the same for a root user ?

          i have done 3 mysqldumps on my vbulletin database and now need to compress them....

          what's the commands from telnet if i log in as root ?
          :: Always Back Up Forum Database + Attachments BEFORE upgrading !
          :: Nginx SPDY SSL - World Flags Demo [video results]
          :: vBulletin hacked forums: Clean Up Guide for VPS/Dedicated hosting users [ vbulletin.com blog summary ]

          Comment


          • #6
            compressing mysqldumps

            Actually, I do remember you. You're George right?

            How are you doing? Did you end up at Maxim? I would love to hear how that's working out for you!

            Anyway, on to business

            To compress your mysql dump files

            do this (while logged in as root or a user with proper permissions):
            gzip -9 filename.txt

            where filename.txt is the name of your mysqldump file.
            (note that it does not need to have a .txt extension)

            You will then have the compressed mysql dump files. When you get them onto the new server, you will need to decompress them first by doing:

            gzip -d filename.txt.gz

            and then you put it into the database like so:
            mysql -p -u[db_username] [databasename] < filename.txt

            NOTE: If you're logged in as root and you have a config file located at ~/.my.cnf(or /root/.my.cnf) which specifies your mysql database password, then you can leave out the "-p -u[username]" part and simply enter:

            mysql [databasename] < filename.txt

            Hope that answers your question, if not please let me know! Also, if you would like me to show you how to setup your .my.cnf file so that you don't have to enter your mySQL password when you login, let me know. It's really really easy.


            Best Regards,
            Matt Lightner
            Site5 Tech Support
            [email protected]


            Comment


            • #7
              you remembered correctly, yep it's me

              hi ya Matt

              I corresponded with Maxim and the bandwidth pricing is excellent (my main concern after admin ease), but i don't know a thing about admin for a server and their support rates are expensive for setting up stuff i.e. US$200 for setting up a domain and stuff

              I decided to go with Rackspace.com for a linux server running a webmin control panel (currently i have 11 of my sites on the server with more to come) - i am learning alot and once i get some admin knowledge under my belt, my 2nd server will be with Maxim

              i dump to a filename.sql file, so this command for compressing would be

              gzip -9 filename.sql
              then ?

              and uncompressing

              gzip -d filename.sql.gz ?

              what if i need to specify a directory location ?

              cause i dump my filename.sql to the directory named 'sql'
              i.e.
              /home/usr/htdocs/sql


              :: Always Back Up Forum Database + Attachments BEFORE upgrading !
              :: Nginx SPDY SSL - World Flags Demo [video results]
              :: vBulletin hacked forums: Clean Up Guide for VPS/Dedicated hosting users [ vbulletin.com blog summary ]

              Comment


              • #8
                Yep!

                You can replace the filename.txt with a relative path or an absolute path.. If you want to decompress to a certain filename, you can do this..

                gzip -dc filename.txt.gz > /home/usr/htdocs/sql/filename.sql

                and that will decompress it to the specified path instead.


                Just a side note: You might want to check out Site5's dedicated server plans. They were just released, and come with a bunch of control panel features, a full-featured server manager and of course.. help from our *friendly* system administrators when you need it


                Best Regards,
                Matt Lightner
                Site5 Tech Support
                [email protected]

                Comment

                widgetinstance 262 (Related Topics) skipped due to lack of content & hide_module_if_empty option.
                Working...
                X