Copy Wordpress database without using Phpmyadmin

Asked

Viewed 5,683 times

7

I need to migrate a Wordpress site from one server to another. One of the necessary steps is to export the database used on the current site, edit some data if necessary (such as the site address and the file Urls) and import the database to the new server.

Is it possible to do this process of exporting/importing without using Phpmyadmin, only with database access data (database name, server, login and password)? Is there any tool that allows you to access the database without being installed on the server itself?

  • Maybe mysqldump will do the trick.

  • You have access to the server by command line (SSH)?

  • No, I believe that not...the two servers are in a service like Locaweb or Uolhost. It’s actually not a specific case, this is a procedure I need to do almost always and it’s not every time I get access to phpmyadmin easily

  • wordpress has its own data import/export system in "Tools". Just access the wp-admin and select the content (or all of it) and export. It generates a zipped file, then just go on the other server, on the same page "Tools" but now on the option "import".

  • Yes, but the export it generates does not come (I believe) in SQL and does not include all the information from the Wordpress installation. This export is useful for some cases, but for migrating from one server to another it is MUCH easier to export and directly import the bank.

  • 1

    Look, if you go to Locaweb I know you have SSH. From the command line you can easily export with the command mysqldump.

Show 1 more comment

6 answers

9

Visual export from administrative panel (no code)

An excellent alternative that use for this type of task is the free plugin All-in-One WP Migration, which allows exporting and importing the SQL database (or all the files from the site if you prefer), from the Wordpress dashboard itself, without having to deal with FTP and file permissions, fully visual.

The plugin installation is done by the Wordpress panel itself in "Plugins > Adicionar Novo". Look for "All-in-One WP Migration".

Instalando o plugin pelo instalador nativo do WordPress

After installation the operation is simple:

  1. On site A: Go to the menu Site Migration > Export export the database (or the full site) with the plugin. In a few moments it will generate a file with the extension .zip;
  2. On site B: Go to the menu Site Migration > Import and drag the file .zip generated in step 1 into the import area.

And just like that!

The plugin works very well and can even be used by customers, for a quick backup of the full site or only the database, just trigger some very simple options.

Another important function of the plugin is to fully visual search and replace the website address and other information (such as the server path), which need be changed in the final database to allow the site to function properly after export.

Tela de exportação do site a partir do plugin

I use the plugin frequently in my projects and recommend it to everyone.

  • Fantastic! I’ve done a local test and worked well, created the package with themes, plugins and sql database...What I liked most was this option to replace the URL in the exported database. Thank you very much!

  • You’re welcome @Enrique_trevelin, success with your projects!

  • @Marcioduarte I’m finishing my first wordpress blog and I’m very worried,as I wanted a complete backup of the entire site including database, plugins, plugins settings, and everything else... When you say "export the database (or the full site) with the plugin" that’s right, even the settings are saved? My concern is the following: On a given day, I lose everything from the site, posts and etc... I would like to take the backup and simply put the site on the air again as if nothing had happened... Thanks for your attention. ;)

  • 1

    Yes, @marcielli, it can export everything anyway. Just select all the options (leave them in green). You can download a backup to your computer or save to Dropbox, Google Drive, etc. Restoration can be done even if the current site "breaks" completely.

  • Ah, got it. I’ll try that then. Thanks for the attention. ;) @Marcioduarte

7


WP-DB-Backup

There is a Wordpress plugin that performs the backup, WP-DB-Backup, where we can read on the page of the same:

WP-DB-Backup Allows you easily to backup your core Wordpress database Tables. You may also backup other Tables in the same database.

That translated:

WP-DB-Backup allows you to easily perform a backup of the configuration tables present in the Wordpress database. You can also backup other tables present in the same database.

Installation

Installation is achieved in four simple steps that can be seen here:

  1. Extract the folder wp-db-backup/ for /wp-content/plugins/;

  2. Enable the plugin in the administrative area under Admin -> Plugins;

  3. The plugin will try to create a directory with the name /wp-content/backup-*/ within the Wordpress directory;

  4. You may need to give write permissions to the directory /wp-content (at least temporarily) so that the plugin can create the directory mentioned in point 3.

    For example:

    $ cd /wordpress/
    $ chgrp www-data wp-content (onde "www-data" é o grupo que o teu cliente de FTP utiliza)
    $ chmod g+w wp-content
    

5

Adminer

The plugin is a Phpmyadmin within Wordpress. It is a complete Mysql database administration tool written in PHP.

The author of the plugin, Frank Bültge, is a star of the German Wordpress school, I have only praise for his work: Allow, Backwpup, Multilingual Press and a wide et cetera of other plugins, projects on Github and participation in Stack Exchange Wordpress Developers.

Main screen

Tela principal do Adminer

Control screen (section Dump, using Start Adminer Inside)

Tela de controle do Adminer


Editing of exported data

For this I use the following procedure:

  • Import the dump Mysql in a local database or an empty one on the server.
  • Use the application Database Search and Replace Script in PHP to replace everything needed (Urls and Paths, mainly).
  • Export this modified database and import to the final server.

2

There is a Mysql tool called Mysql Workbench which I personally find more practical than using phpMyAdmin. Many things can be done with it, including importing and exporting the database. However, it requires installation on your computer, which I don’t know if it will be a problem for you.

1

You can use the Navicat, so you will not need plugins or third parties. You will create a direct connection between servers.

And here a video tutorial how to use it.

  • Good response but if possible try posting the Navicat link or even the documentation link ;) upvote

0

  • Updraft is really great, but to migrate between sites - which was the original question - you need to buy an additional module, Updraf Migrations: https://updraftplus.com/faqs/how-do-i-migrate-to-a-new-site-location/

Browser other questions tagged

You are not signed in. Login or sign up in order to post.