• I discovered the migration code shardb uses copies the full table into memory and then writes it again to the new database.

    This might be so it can work across servers and less likely for old mysql that doesn’t have rename table, but for installs that are completely on the same single server it would be radically faster by like minutes vs hours to use mysql’s rename table.

    Copying via php also has the problem of really large tables that exceed php/wordpress memory size, even when radically increased since the current script tries to do it in one pass.

    Working on some code, will share later if anyone is interested.

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author Ron Rennick

    (@wpmuguru)

    The reason for the full copy vs rename is that the destination DB might be on a different server.

    It’s also a one time process. I’ve run the migration on a fairly large well established install and it’s only taken a few minutes. While I have seen the migration script used on a network with 70K+ sites, installs that large are edge cases. They are also the ones most likely to be implementing multiple DB servers.

    Plugin Author Ron Rennick

    (@wpmuguru)

    A secondary consideration for this is that if you move the tables and subsequently find you have a incompatibility issue with a theme or plugin you don’t have a ready means of rolling back. When the tables are copied you can just remove db.php to switch back to the single DB configuration.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘High-speed migration via rename table?’ is closed to new replies.