Backup to rebuild another server with a different schema

There can be a situation where you want to have a different schema on another server. In that case, you have to dump and restore the schema, alter the schema as you need, and then dump and restore the data. Altering the schema with data can take a long time, depending on the amount of data you have. Note that this method will work only when the modified schema is compatible with inserts. The modified table can have extra columns but it should have all the columns present in the original table.

Get MySQL 8 Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.