HI all --
I am singlehandedly building my first full-blown drupal site (using 7), rolling it out (for an art project that's already live), and testing additional modules and blocks etc.
On the web server I have created a protected "sandbox" subdomain as my "test server". I am trying to find the easiest way to move the test files to the "production server" (i.e., out of the subdomain and into the TLD), and to move files back when I want to do more testing & development but using all the latest settings etc from the live site as my starting point.
I have tried simple download/upload via ftp -- permissions all get screwed on the sites/defaults/files/xxx path
I have tried gzip, download, upload tar -- the "sites" directory ends up empty
it's a major drag to have to go into an ssh session to do chowns & chmods every time i move stuff back and forth.
There must be an easier way.
If the easier way involves straight CLI please be gentle, CLI still freaks me out
thanks!
kazar
Kazar,
from the directory you're in tar -zcf ~/FILENAME.tar.gz ./
Will create the tar.gz and should store the permissions
then extract the file in the right place with tar -zxf ~/FILENAME.tar.gz
that should do it - and then you'll create a backup too....
need more info?
On 6/12/2011 1:33 AM, adept techlists - kazar wrote:
HI all --
I am singlehandedly building my first full-blown drupal site (using 7), rolling it out (for an art project that's already live), and testing additional modules and blocks etc.
On the web server I have created a protected "sandbox" subdomain as my "test server". I am trying to find the easiest way to move the test files to the "production server" (i.e., out of the subdomain and into the TLD), and to move files back when I want to do more testing& development but using all the latest settings etc from the live site as my starting point.
I have tried simple download/upload via ftp -- permissions all get screwed on the sites/defaults/files/xxx path
I have tried gzip, download, upload tar -- the "sites" directory ends up empty
it's a major drag to have to go into an ssh session to do chowns& chmods every time i move stuff back and forth.
There must be an easier way.
If the easier way involves straight CLI please be gentle, CLI still freaks me out
thanks!
kazar
Dan Horning mailto:dan.horning@planetnoc.com June 12, 2011 2:11 AM
Kazar,
from the directory you're in tar -zcf ~/FILENAME.tar.gz ./
Will create the tar.gz and should store the permissions
then extract the file in the right place with tar -zxf ~/FILENAME.tar.gz
that should do it - and then you'll create a backup too....
need more info?
ah that makes sense. I do know about man pages but when i try to read them and understand what they're really talking about my eyes bleed and my brain smokes. I often wish for just plain-english explanations and some better examples in man pages.
I will file this info for protecting permissions when tarring and untarring files.
However, as per my f/u post submitted a moment ago, I'm realizing I don't have to DL/UL at all, my sandbox is simply a subdomain of the production server. I can just copy from the command line I think (and then restore the target server's original settings.php file)
and here i sat DLing and ULing via sftp, very slow!!!!!
thanks again,
kazar
OK, I must have finally hit the right search string on Google. I found a page that offers a command for copying the site's files from one directory to another while retaining permissions: | cp -rp drupal_source drupal_destinatio|n
But then the instructions continue with the sort of stuff that scares me to try because I don't know what most of this stuff means:
* Update references to Drupal url, path, and database details (name, user, pass, and host). Sample commands below using grep: |find /path/to/drupal -type f -exec perl -pi -e "s/example.com/example2.com/g" {} ; find /path/to/drupal -type f -exec perl -pi -e "s/public_html/example/public_html/example2/g" {} ; find /path/to/drupal -type f -exec perl -pi -e "s/db_name/db_name2/g" {} ; find /path/to/drupal -type f -exec perl -pi -e "s/db_user/db_user2/g" {} ; find /path/to/drupal -type f -exec perl -pi -e "s/db_pass/db_pass2/g" {} ;| *
I know enough to understand that this is some sort of grepping/perl script (pardon me if my vocabulary here is laughable) to fix any absolute path references.
BUT ... I don't understand why there would be any. When I link from one page to another on my site I only use the relative path. I would hope that images inserted into node content would also have internal references in the database.
Am I wrong? Is it really necessary to do anything other than to keep the settings.php files distinct for the public domain and the protected subdomain that serves as my sandbox?
btw, i also use two separate databases. So I do understand that both the baseURL and databasename in settings.php will be different for production vs. sandbox
I have noticed that everyone out on the World Wide Web seems to have a different "truth" when it comes to how best to move a Drupal site
Yet I appreciate any input from this list!!
kazar
found the solution after a bit more web-fishing.
To *copy* drupal files from one directory to another directory on the same server while preserving permissions:
Starting from the source directory:
find . -depth -print | cpio -pdlmv [newdir]
:-)
soooooo much faster than the silly zip/DL/UL/unzip rigamarole i'd been trying to do
kazar
Hi,
On 14.06.11 11:24, adept techlists - kazar wrote:
Starting from the source directory:
find . -depth -print | cpio -pdlmv [newdir]
why not use: cp -a <old-dir> <new-dir>
See here for manual page: http://www.freebsd.org/cgi/man.cgi?query=cp&apropos=0&sektion=0&...
Bye Matthias
Matthias Fechner mailto:idefix@fechner.net June 14, 2011 7:01 AM
Hi,
why not use: cp -a <old-dir> <new-dir>
"why not" is because I'm not a web server admin nor unix geek and i look for answers via Google! :-)
thanks much!
I just tried this suggestion using:
cp -a public_html/ public_html/sandbox cp: cannot copy a directory, `public_html/', into itself, `public_html/sandbox/public_html'
(since sandbox is a subdomain i use for testing it is actually within the public_html folder)
according to http://www.freebsd.org/cgi/man.cgi?query=cp&apropos=0&sektion=0&...:
also tried adding the -R switch:
cp -Ra public_html/ public_html/sandbox/ cp: cannot copy a directory, `public_html/', into itself, `public_html/sandbox/public_html'
what am I doing wrong?
thanks
kazar
Matthias Fechner mailto:idefix@fechner.net June 14, 2011 7:01 AM
Hi,
why not use: cp -a <old-dir> <new-dir>
See here for manual page: http://www.freebsd.org/cgi/man.cgi?query=cp&apropos=0&sektion=0&...
Bye Matthias
adept techlists - kazar mailto:techlists@ade.pt June 14, 2011 5:24 AM
found the solution after a bit more web-fishing.
To *copy* drupal files from one directory to another directory on the same server while preserving permissions:
Starting from the source directory:
find . -depth -print | cpio -pdlmv [newdir]
:-)
soooooo much faster than the silly zip/DL/UL/unzip rigamarole i'd been trying to do
kazar
adept techlists - kazar mailto:techlists@ade.pt June 12, 2011 1:33 AM
HI all --
I am singlehandedly building my first full-blown drupal site (using 7), rolling it out (for an art project that's already live), and testing additional modules and blocks etc.
On the web server I have created a protected "sandbox" subdomain as my "test server". I am trying to find the easiest way to move the test files to the "production server" (i.e., out of the subdomain and into the TLD), and to move files back when I want to do more testing & development but using all the latest settings etc from the live site as my starting point.
I have tried simple download/upload via ftp -- permissions all get screwed on the sites/defaults/files/xxx path
I have tried gzip, download, upload tar -- the "sites" directory ends up empty
it's a major drag to have to go into an ssh session to do chowns & chmods every time i move stuff back and forth.
There must be an easier way.
If the easier way involves straight CLI please be gentle, CLI still freaks me out
thanks!
kazar
adept techlists - kazar wrote:
I just tried this suggestion using:
cp -a public_html/ public_html/sandbox cp: cannot copy a directory, `public_html/', into itself, `public_html/sandbox/public_html'
If it would allow that it would cause an infinite recursion. To resolve you need to do:
cp -a public_html/* public_html/sandbox/
This will cause the contents of public_html to be copied and not public_html itself. The added / on the end of sandbox ensures that you are copying to a directory otherwise you run the risk of copying the contents to a file which is pointless.
Thanks Earnie -- i will try that one next time I copy my production site into the sandbox!
Earnie Boyd mailto:earnie@users.sourceforge.net June 22, 2011 7:32 AM
If it would allow that it would cause an infinite recursion. To resolve you need to do:
cp -a public_html/* public_html/sandbox/
This will cause the contents of public_html to be copied and not public_html itself. The added / on the end of sandbox ensures that you are copying to a directory otherwise you run the risk of copying the contents to a file which is pointless.
adept techlists - kazar mailto:techlists@ade.pt June 22, 2011 6:09 AM
I just tried this suggestion using:
cp -a public_html/ public_html/sandbox cp: cannot copy a directory, `public_html/', into itself, `public_html/sandbox/public_html'
(since sandbox is a subdomain i use for testing it is actually within the public_html folder)
according to http://www.freebsd.org/cgi/man.cgi?query=cp&apropos=0&sektion=0&...:
also tried adding the -R switch:
cp -Ra public_html/ public_html/sandbox/ cp: cannot copy a directory, `public_html/', into itself, `public_html/sandbox/public_html'
what am I doing wrong?
thanks
kazar
Matthias Fechner mailto:idefix@fechner.net June 14, 2011 7:01 AM
Hi,
why not use: cp -a <old-dir> <new-dir>
See here for manual page: http://www.freebsd.org/cgi/man.cgi?query=cp&apropos=0&sektion=0&...
Bye Matthias