Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6802189
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T19:11:36+00:00 2026-05-26T19:11:36+00:00

I have basically MySQL dump from a WordPress database with some data. The whole

  • 0

I have basically MySQL dump from a WordPress database with some data. The whole dump is about 20MB and roughly 500 queries, so it doesn’t take forever to load, but it’s not super fast either.

I need ot use that database in my other application, and to do that, I have to change the schema, i.e. rename tables, columns, drop some columns, drop tables, create new tables and import data into them, etc.

In reality, I’m going to alter almost every single column. The question is, how should I write a script like that?

I’d like to be able to have one script that I can execute on a recent dump, that will convert the database to a required form. Which means that if I start typing ALTER TABLE queries and then executing them, I’m going to have to re-import the database every time I want to test the whole script, which doesn’t seem very effective to me. Is there any better way to do this?

Can I somehow run a bunch of queries, look at what they did, and then hit a button to move the database back to it’s original state?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T19:11:36+00:00Added an answer on May 26, 2026 at 7:11 pm

    I’m not 100% certain I understand your question, but I think you might be looking for

    CREATE TABLE new_table LIKE other_database.old_table;
    

    This would allow you to keep a “canonical” version of the old database untouched. Your ALTER TABLE statements would execute against the new tables.

    Apart from the ability to run your whole script as a single transaction, there’s no simple sub-millisecond UNDO for these kinds of schema changes.

    Having said all that, if a developer came to me and said “I’m going to routinely alter almost every single column”, I’d look at that as a big red flag, billowing in the wind.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Okay, basically, I have formed a mySQL query which returns a data set all
basically i have this problem i have a table of posts(in my mysql database)
Basically I have a mysql query something like the following: mysql_query(SELECT n.title, v.value FROM
I have had some issues with a site (basically MySQL is killing the proccessor)
Can I get some help with a MySQL JOIN? Basically I have 4 tables,
I have a method that basically returns the results of a mysql query. public
Basically, I have multiple URL's stored in a MySQL table. I want to pull
displaying html problem with php & mysql Hi basically i have a quick mysql_fetch_array
I am using C++ and MySQL. I have data objects I want to persist
I have a mysql database with movies as follows: MOVIES(id,title) KEYWORDS_TABLE(id,key_id) [id is referenced

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.