GoFuckYourself.com - Adult Webmaster Forum

GoFuckYourself.com - Adult Webmaster Forum (https://gfy.com/index.php)
-   Fucking Around & Business Discussion (https://gfy.com/forumdisplay.php?f=26)
-   -   Easiest Way 2 Transfer??? (https://gfy.com/showthread.php?t=751848)

Barefootsies 07-16-2007 06:32 AM

Easiest Way 2 Transfer???
 
I am in the middle of some redesigns of some membership paysites. Thousands of pictures, and videos. I am adding in new CMS as I get to each new site when completed.

My question is I want to move hosts, and I obviously do not want to spend 6 months reuploading everything to the new site, and script. So...

What's the easiest way to move all of the stuff?

Put it on a 2nd HD, and put on the server, and then cut n paste to move them all and get it done that way (I've done it like that once before. A pain, but faster than uploading)?

Have copies of the sites moved to a new host, and then do as mentioned above, then delete it once I have everything in a new CMS/website?

Anyone had to do this before? What did you do? Webhosts with recommendations???

Thanks in advance.

:helpme

stickyfingerz 07-16-2007 06:35 AM

Talk to your host they can probably do the transfer. We were looking at having to do the same thing but just ended up using the host that the sites were on. Pretty happy with them.

directfiesta 07-16-2007 06:36 AM

rsync if you have shell on both ....

100 gigs should take about a day.

ServerGenius 07-16-2007 06:41 AM

Here's a shell script to do the transfer of ssh with rsync. If you need help
with it hit me up.

Code:

#!/bin/bash
#
# Hans Waasdorp : [email protected]
#
# rsync transfer script
# script can also run from cron to sync content over multiple servers
# it only updates files that have been changed since the last run, will
# preserve permissions and ownership. It will remove files that are no
# no longer available on the source server.



source /root/.bashrc

# Path we want to transfer
SOURCE="/www/"

# Path where we want to store the transfer
DESTINATION="[email protected]:/www/"

# Debug for verbose transfer stats
DEBUG=0

# Testrun if set to 1 it will do a dry run without transferring anything
TESTRUN=0

LOCKFILE="/tmp/rsynch.lock"

# any stuff you don't want to transfer
EXCLUDEPATTERNS="--exclude=*.log"

if [ "x$DEBUG" == "x1" ]; then
        OPTIONS="--stats --progress"
fi
if [ "x$TESTRUN" == "x1" ]; then
        OPTIONS="-n --stats --progress"
fi

if [ ! -f $LOCKFILE ]; then

        touch $LOCKFILE
        trap 'rm -f ${LOCKFILE} >/dev/null 2>&1' 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
        rsync -e "ssh -i /root/.ssh/id_dsa" -u -aH $EXCLUDEPATTERNS --delete --force --partial $OPTIONS $SOURCE $DESTINATION
else
        exit 1
fi


Way3 07-16-2007 06:49 AM

Quote:

Originally Posted by directfiesta (Post 12768310)
rsync if you have shell on both ....

100 gigs should take about a day.

In most cases, rsync wiil be your best option! Best of Luck! :)

Barefootsies 07-16-2007 07:05 AM

Thanks gents. Bookmarked. :)

Well I have been happy with my main host for the better part of a decade. But with my billing changes over the past couple of years, and more competitive pricing I am looking at moving my hosting on almost all sites.

Since I am trying to get all of my sites redesigned, adding in CMS, and some extra spice, I figured now is a good time to look into moving everything as well. Obviously the amount of time to move all this on ONE site, much less half a dozen would be extremely time consuming. So I do not want to have to spend months doing that, or hiring people.

The main issue is that with the new scripts, I will not be able to just transfer over, and tada it is up and working. I would have to get new script installed on new host. Then move/post/catagorize old stuff into the new format, and once it's complete, end old hosting.

I know when I did this on my celebrity site a few years back it took a good 3-4 months to get 5000+ celebs, 100's of thousands of pictures, all their movies, and shit into the new script (considering the time available for such a task).

:Oh crap

ServerGenius 07-16-2007 07:08 AM

Quote:

Originally Posted by Barefootsies (Post 12768397)
Thanks gents. Bookmarked. :)

Well I have been happy with my main host for the better part of a decade. But with my billing changes over the past couple of years, and more competitive pricing I am looking at moving my hosting on almost all sites.

Since I am trying to get all of my sites redesigned, adding in CMS, and some extra spice, I figured now is a good time to look into moving everything as well. Obviously the amount of time to move all this on ONE site, much less half a dozen would be extremely time consuming. So I do not want to have to spend months doing that, or hiring people.

The main issue is that with the new scripts, I will not be able to just transfer over, and tada it is up and working. I would have to get new script installed on new host. Then move/post/catagorize old stuff into the new format, and once it's complete, end old hosting.

I know when I did this on my celebrity site a few years back it took a good 3-4 months to get 5000+ celebs, 100's of thousands of pictures, all their movies, and shit into the new script (considering the time available for such a task).

:Oh crap

doesn't have to be hard at all, first setup the webserver with vhost containers then use the rsync script for the content. I can get you
a script for mysql databases as well. Most scripts will just work if you don't
change the structure...except if they have have static ips defined somewhere
but that's easy to fix.

:2 cents:

Barefootsies 07-16-2007 07:13 AM

Quote:

Originally Posted by ServerGenius (Post 12768407)
doesn't have to be hard at all, first setup the webserver with vhost containers then use the rsync script for the content. I can get you
a script for mysql databases as well. Most scripts will just work if you don't
change the structure...except if they have have static ips defined somewhere
but that's easy to fix.

:2 cents:

Awesome. :thumbsup:thumbsup:thumbsup

ServerGenius 07-16-2007 07:13 AM

Quick and easy mysql backup script

Code:

#!/bin/bash

#
# Mysql Backup Script
# Hans Waasdorp [email protected]
#

TODAY=`/bin/date +%d-%m-%y`

BACKUP_MYSQL=1

DEST_DIR="/path/to/backup/dir"

DESTINATION_DIR="$DEST_DIR/$TODAY"
KEEP_DAYS=7

# edit below PASSWD="password" and USER="username" to your mysql username and password

if [ $BACKUP_MYSQL -eq 1 ]; then
  PASSWD="password"
  USER="username"
  DATABASES=`mysql -BN -u $USER --password=$PASSWD -e 'SHOW DATABASES;'`

  if [ -x /usr/bin/mysqldump ]; then
    for db in $DATABASES; do
      mkdir -p $DESTINATION_DIR
      cd $DESTINATION_DIR
      /usr/bin/mysqldump --opt -u $USER --password=$PASSWD $db | gzip - | cat - > mysql.$db.dump.gz
    done
  fi
fi

/usr/bin/find $DEST_DIR/ -type d -mtime +$KEEP_DAYS | xargs rm -rf 2>&1 > /dev/null


ServerGenius 07-16-2007 07:25 AM

Fuck it if you have a debian linux box you can use this for creating the apache
vhost container from a shell command. If you have other linux quite easy to
adapt so that it will work.

Code:

#!/bin/sh

# --(( Apache VirtualHost Configuration Tool v1.0 ))--
#
# Hans Waasdorp [email protected]
#
# Vhost is a very simple shell script to easily add virtual hosts to an
# Apache webserver. It prompts for a domain name and root directory, 
# appends a virtual host entry to httpd.conf, and restarts Apache.

# variables - edit these to fit your environment

CONF=/etc/apache2/vhost.conf    # location of Apache conf file
[email protected]            # email appended to server errors,etc.
INDEX1=index.html              # default index file
INDEX2=index.php                # alternate index file
PID=/var/run/apache2.pid        # location of httpd.pid

# Don't edit anything below

SERVER="$1"
DOCROOT="$2"
USER="$3"
IP="$4"

if [ ! "$*" ]
then
echo
echo " --(( Apache VirtualHost Configuration Tool v1.0 ))--"
echo
echo "      Usage: vhost [domain] [webroot] [username] [ipaddress]"
echo
echo "      domain = yourdomain.com (leave out www)"
echo "      webroot = path to website directory, i.e. /home/username/www/yourdomain.com"
echo "      username = your username"
echo "      ipaddress = ipaddress to use for vhost"
echo
exit 1
fi

if [ -e "$CONF" ]
        then
                cp $CONF $CONF.bak
        else
                echo "No changes made - vhost.conf file not found!"
                exit 1
fi

echo "
<VirtualHost $IP>
    ServerAdmin $EMAIL
    ServerName $SERVER
    ServerAlias www.$SERVER
    DocumentRoot $DOCROOT
    DirectoryIndex $INDEX1 $INDEX2
        ErrorLog /var/log/apache2/vhosts/$SERVER.error.log
        CustomLog /var/log/apache2/vhosts/$SERVER.access.log combined
  <Directory />
      Options -Indexes +FollowSymLinks
      AllowOverride None
      Order allow,deny
      allow from all
  </Directory>
  <Directory $DOCROOT>
      Options All -Indexes +FollowSymLinks +MultiViews
      AllowOverride All
      Order allow,deny
      allow from all
  </Directory>
</VirtualHost>
" >> $CONF

mkdir -p $DOCROOT
chown -R $USER:$USER $DOCROOT

if [ -e "$PID" ]
        then
                kill -HUP `cat $PID`
                echo
                echo "- added VirtualHost to vhost.conf"
                echo "- old vhost.conf renamed to vhost.conf.bak"
                echo "- restarted Apache"
                echo
                exit 0
        else
                echo "Couldn't restart Apache - apache2.pid not found!"
                exit 1
fi


ServerGenius 07-16-2007 07:25 AM

who said I never contribute :winkwink:

ServerGenius 07-16-2007 07:37 AM

Apache vhost tool once again.....i forgot to build in a check before creating
the new vhost docroot.

Code:

#!/bin/sh

# --(( Apache VirtualHost Configuration Tool v1.0 ))--
#
# Hans Waasdorp [email protected]
#
# Vhost is a very simple shell script to easily add virtual hosts to an
# Apache webserver. It prompts for a domain name and root directory, 
# appends a virtual host entry to httpd.conf, and restarts Apache.

# variables - edit these to fit your environment

CONF=/etc/apache2/vhost.conf    # location of Apache conf file
[email protected]            # email appended to server errors,etc.
INDEX1=index.html              # default index file
INDEX2=index.php                # alternate index file
PID=/var/run/apache2.pid        # location of httpd.pid

# Don't edit anything below

SERVER="$1"
DOCROOT="$2"
USER="$3"
IP="$4"

if [ ! "$*" ]
then
echo
echo " --(( Apache VirtualHost Configuration Tool v1.0 ))--"
echo
echo "      Usage: vhost [domain] [webroot] [username] [ipaddress]"
echo
echo "      domain = yourdomain.com (leave out www)"
echo "      webroot = path to website directory, i.e. /home/username/www/yourdomain.com"
echo "      username = your username"
echo "      ipaddress = ipaddress to use for vhost"
echo
exit 1
fi

if [ -e "$CONF" ]
        then
                cp $CONF $CONF.bak
        else
                echo "No changes made - vhost.conf file not found!"
                exit 1
fi

echo "
<VirtualHost $IP>
    ServerAdmin $EMAIL
    ServerName $SERVER
    ServerAlias www.$SERVER
    DocumentRoot $DOCROOT
    DirectoryIndex $INDEX1 $INDEX2
        ErrorLog /var/log/apache2/vhosts/$SERVER.error.log
        CustomLog /var/log/apache2/vhosts/$SERVER.access.log combined
  <Directory />
      Options -Indexes +FollowSymLinks
      AllowOverride None
      Order allow,deny
      allow from all
  </Directory>
  <Directory $DOCROOT>
      Options All -Indexes +FollowSymLinks +MultiViews
      AllowOverride All
      Order allow,deny
      allow from all
  </Directory>
</VirtualHost>
" >> $CONF


if [ ! -d "$DOCROOT" ]
        then
                echo "Creating vhost docroot"
                mkdir -p $DOCROOT
                chown -R $USER:$USER $DOCROOT
        else
                exit 1
fi

if [ -e "$PID" ]
        then
                kill -HUP `cat $PID`
                echo
                echo "- added VirtualHost to vhost.conf"
                echo "- old vhost.conf renamed to vhost.conf.bak"
                echo "- restarted Apache"
                echo
                exit 0
        else
                echo "Couldn't restart Apache - apache2.pid not found!"
                exit 1
fi


ServerGenius 07-16-2007 09:50 AM

bump for people who can use some simple but handy shell scripts


All times are GMT -7. The time now is 06:45 PM.

Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2025, vBulletin Solutions, Inc.
©2000-, AI Media Network Inc123