It’s considered best practice to have two separate databases (one for production, one for development) then migrate the database as detailed here. If you, for example, install a database-changing plugin on one but not the other, you risk breaking one of your sites until you duplicate those changes over. If you’re working late tweaking code, you might end up breaking your live site and not realizing it until the angry client calls to rip you a new one.
Really, keep your production and development sites completely separate. It will save you a number of hassles down the road.
If you only have access to a single database, set each site to use a different database prefix. This ensures easy duplication with standard SQL tools while keeping separate dev/prod environments.
Related Posts:
- What is this JavaScript “require”?
- Oracle SQL query for Date format
- Failed to connect to mysql at 127.0.0.1:3306 with user root access denied for user ‘root’@’localhost'(using password:YES)
- Can I have multiple primary keys in a single table?
- How can I make updates to a site, on a development copy, but then move updates back without overriding live site’s evolving database?
- get_results using wpdb
- wpdb->insert multiple record at once
- How to migrate a HTTPS WordPress installation to localhost?
- Database connection close
- How to monitor server for error establishing a database connection
- How to create bulk page and content? [closed]
- Importing posts from old website to new conflicting post ID’s?
- Fatal error: Call to undefined function dbDelta()
- Connect to remote database using Localhost install
- remove missing image attachments
- Transient RSS feeds in wp_options not removed automatically?
- Best way to move live site local
- The revisions table in my database is at 70% capacity and growing. What should I do?
- WordPress for a very large website
- How to ensure data consistency in WordPress
- Database location in WordPress
- WooCommerce with thousands of products – site is very slow – optimize db queries? [closed]
- WP_list_table bulk_action get edit and delete
- How to display data from custom table in wordpress database?
- Change SQL get_results to search for posts with custom term in custom taxonomy
- How to diagnose and keep in check encoding issues?
- Add search Value to wp_list_table pagination
- stdObject stored in database. How does one convert it to usable format?
- I have a table I created, how do I make a form for a user to filter the data?
- What ALL can cause “Another update is currently in progress.”? [closed]
- Trigger Plugin database update after git pull
- wp_redirection_404 table has grown to 7GB
- Does WordPress ever need multiple databases?
- Why are no posts showing despite my apparently correct DB restoration?
- Should I remove transients from the wp_options table?
- Delete all post meta except featured image Using SQL
- Show last modified date of database
- What generates these very slow postmeta queries? [closed]
- How to migrate a website based on a custom database to wordpress?
- Maintain user profile data in a non-WordPress database
- How to scan barcode and store data into a database [closed]
- Fetching values from database for select box
- Setup private content for specific users with daily updates [closed]
- fastest replacement DB
- Call to undefined function get_user_meta() – trying to access data in MySQL from custom fields
- Connection refused on locahost after importing database?
- When to use custom DB tables or add_option?
- Have working sql query… trying to adjust it to use $wpdb
- Best host for running large mem and processor intensive WordPress sites?
- creating new field on mysql
- Does WordPress store the username as a primary key in the database?
- Strange characters added to the database
- WSOD 3.9.1 – Tried Everything so far
- Database Update Required – Update from command-line
- After database migration, theme mods don’t show [closed]
- SQL query to set posts in bulk based on the post content
- Automate WordPress website setup with prefilled data
- Custom search query by category id
- How do you render posts from outside wordpress?
- Website displays old version of page
- Image link issues after importing a database backup to my local web server
- multiple wordpress installs w/shared user database but separate content databases
- Fetch a single row from a custom table for to a given ID
- Database create or redirect
- Updating seperate database when post attachment is changed
- add featured image dialog box disappear
- Displaying table data on a page
- Database structure cheatsheet
- WordPress Database – wp_usermeta and the correct number of session_tokens rows
- How to escape percentage sign(%) in sql query with $wpdb->prepare?
- How to get a list of articles related to a particular category from my other WordPress website?
- /wp-admin not accessible after migrating to local host (no plugin issue)
- set_transient fails if the value has more than 60.000 characters
- A WP dev site that displays content from a live site’s database but cannot write to wp_posts?
- error establishing database connection (WAMP + filezilla)
- Is there a way for two deferent themes to consume two different DB on a same WP instance?
- Set SQL_BIG_SELECTS and MAX_JOIN_SIZE on a WP_Query
- How do I update a WordPress wp_postmeta meta_value that contains many options
- How can I get $wpdb to show MySQL warnings?
- About wp database hooks (error establishing connection)
- Database for JQuery Autocomplete field
- Auto populate form fields based on serial input or pull listings from other websites?
- How to extract some part of WordPress full source code
- Create Tables in WordPress
- Error establishing a database connection for some files
- Hash user emails in database?
- WordPress Failed to Login (DB Error)
- Share WordPress Database
- DB access blocked when initializing WP externally
- Saving data to database and exporting to excel
- Site does not work right, pages not showing up, even for root admin
- ERROR: “Table Prefix” must not be empty
- How do you build a database-centric site in WP?
- One information repeated on multiple locations on one site [closed]
- WordPress: Interact with Database Query Data and Login
- Attach posts based on category and position
- Showing Error(TAble already exist)
- Getting an error when trying to migrate to DV server from Grid with Media Temple [closed]
- SQL query to rewrite all media URLs to end with .webp
- Many images in wp-content/uploads folder that are not in Media Library