Welcome to WebmasterWorld Guest from 34.204.191.31

Forum Moderators: Ocean10000 & phranque

Message Too Old, No Replies

Preserve timestamps during server migration

Keep date last modified while migrating to a different virtual server

     
6:16 pm on Aug 23, 2016 (gmt 0)

New User

10+ Year Member

joined:Jan 17, 2004
posts: 17
votes: 0


I’ve had a website for a long time and am finally adding SSL, which my hosting company provides only by moving to a different virtual LAMPy server (and apologies if I’m posting in the wrong place).

How do I keep the dates last modified untouched during the migration?
6:31 pm on Aug 23, 2016 (gmt 0)

Administrator from CA 

WebmasterWorld Administrator bakedjake is a WebmasterWorld Top Contributor of All Time 10+ Year Member Top Contributors Of The Month

joined:Apr 8, 2003
posts:3883
votes: 61


Try:

$ touch -m --date="1984-04-01" file.txt
7:10 pm on Aug 23, 2016 (gmt 0)

Senior Member from GB 

WebmasterWorld Senior Member graeme_p is a WebmasterWorld Top Contributor of All Time 10+ Year Member Top Contributors Of The Month

joined:Nov 16, 2005
posts:3006
votes: 207


When file transfer is the problem, rsync is usually the solution.

Transfer the files with rsync, using the -a option (to also preserve permissions and a lot of other things) or -t
1:44 pm on Aug 25, 2016 (gmt 0)

New User

10+ Year Member

joined:Jan 17, 2004
posts: 17
votes: 0


Thank you!

@bakedjake: Using “Send Raw Command…” on MacOS’s Transmit.app returns a blank response and no changes

@graeme_p: I’m trying rsync using MacOS’s Terminal.app with a VPN:
rsync -av rsync://me@example.com/test /Users/me/test
and I receive an error “failed to connect to example.com: Operation timed out”.

Because it never asked for my FTP password, my next step was going to be to try
rsync -av rsync://me:PASSWORD@example.com/test /Users/me/test
but sending a password like that would look like a bad idea. Thoughts?