Exporting files to another server

Mark Smith smitty at gmail.com
Mon Jan 28 19:14:37 UTC 2008


> If you can handle the downtime, a simple script will do the trick..
>
> //psudocode...
>
> query "select * from file where fid > XXX order by fid asc limit $chunk"
> foreach $rows as $row
>   $data = $oldm->get($row['dkey']);
>    $newm->save($row['dkey'], class, $data);
>
> you can multi-thread that too, just have each client do a separate chunk of
> id space.
>
> if you have too many files, just move the physical drives over, make the
> changes in the db and start it all back up. should work.

That's a good way to do this.  Just iterate over the files, get them
from the old cluster, put them to the new one.  Let replication catch
up at the end.  Call it good.

This can actually be done with the old site online, but that
complicates it slightly because you MUST process files sequentially in
case they get overwritten later... but it's probably best to do it
while offline.  :-)


-- 
Mark Smith / xb95
smitty at gmail.com


More information about the mogilefs mailing list