Topic on User talk:Aaron Schulz

Using copyFileBackend.php to copy from old file repo to swift cloud

2
79.182.244.237 (talkcontribs)

Hi Aaron,

I'm really impressed with your SwiftCloudFiles, it works really well, so well in fact that I want to move my current image directory to cloud files. I understand that the best way to do this would be to use the copyFileBackend.php copying from local-backend to the localSwift backend. However, the new backend has containers and the old one doesn't as far as I know. Is there some way to do this easily? Searching on google I saw your name associated with the copyFileBackend.php file so I thought you would be the expert on this matter.

Thank you very much for any help and this great extension!

Keith

Aaron Schulz (talkcontribs)

The "containers" in the old (file system) one are just directories. The copy script works easily as long as your repo zones are not tested. By that I mean that the "public", "temp", "thumb", and "deleted" zones are all in sibling directories. Unfortunetely, they probably are not, since the default directories for MW have (public -> ../images, thumb -> ../images/thumb, temp -> ../images/temp, deleted -> ../images/deleted). This can still be worked around by using the "subdir" argument to copyFileBackend.

You could still do something like "php copyFileBackend.php --src local-backend --dst local-swift --containers local-public --subdir <X>", running it from an sh script for all X in "0 1 2 3 4 5 6 7 8 9 a b c d e f archive/0 archive/1 archive/2 archive/3 archive/4 archive/5 archive/6 archive/7 archive/8 archive/9 archive/a archive/b archive/c archive/d archive/e archive/f". Then run it for local-deleted for all X in "0 1 2 3 4 5 6 7 8 9 a b c d e f g h i j k l m n o p q r s t u v w x y z". This is basically what Wikimedia did.

There is the issue of writes that happen while you copy. For small wikis, one can just make the wiki read only while copying (there are ways to avoid this if needed).

Reply to "Using copyFileBackend.php to copy from old file repo to swift cloud"