Trusted WordPress tutorials, when you need them most.
Beginner’s Guide to WordPress
Copa WPB
25 Million+
Websites using our plugins
16+
Years of WordPress experience
3000+
WordPress tutorials
by experts

Cómo trasladar WordPress de un servidor local a un sitio activo (2 métodos)

Nota editorial: Ganamos una comisión de los enlaces de socios en WPBeginner. Las comisiones no afectan a las opiniones o evaluaciones de nuestros editores. Más información sobre Proceso editorial.

Muchos usuarios de WordPress prefieren trabajar en sus sitios web utilizando un servidor local en su ordenador antes de transferirlo a un servidor de alojamiento en vivo.

Le permite trabajar en su sitio web de forma privada antes de que los cambios estén disponibles en línea.

Con el tiempo, tendrá que moverlo a un servidor en vivo para que esté disponible para los visitantes en línea.

En este artículo, le mostraremos instrucciones paso a paso sobre cómo trasladar WordPress de un servidor local a un sitio activo.

How to move WordPress from local server to live site (2 methods)

¿Por qué trasladar WordPress de un servidor local a un sitio activo?

Construir su blog de WordPress en un servidor local es una forma segura de probar los cambios en su sitio web sin afectar a los visitantes.

Cuando haya terminado de perfeccionar su sitio web, el siguiente paso es pasar de su servidor local a un sitio activo.

Vamos a mostrarle dos formas de trasladar su sitio de un servidor local a un sitio activo.

El primer método utiliza un plugin de migración de WordPress y se recomienda para principiantes.

En el segundo método, le mostraremos cómo trasladar manualmente WordPress de un servidor local a un sitio activo.

Puede elegir el método que más le convenga:

Antes de migrar su sitio WordPress

Para migrar WordPress de un servidor local a un servidor en vivo, es necesario tener algunas cosas en su lugar.

En primer lugar, suponemos que usted tiene un sitio de WordPress que se ejecuta en un servidor local (también llamado localhost) en su ordenador y que tiene pleno acceso a él.

A continuación, tendrá que tener un nombre de dominio y alojamiento web.

Para facilitarte la decisión, te recomendamos Bluehost. Son una empresa de alojamiento de WordPress recomendada oficialmente, y están dando a los usuarios de WPBeginner un descuento exclusivo + dominio y SSL gratis.

Básicamente, puedes empezar por tan sólo 1,99 $ al mes.

Si quieres una gran alternativa a Bluehost, puedes mirar Hostinger. También están ofreciendo un descuento exclusivo a los usuarios de WPBeginner con un nombre de dominio gratis.

Si puedes permitirte pagar un poco más, entonces comprueba SiteGround. También tienen una oferta especial para los lectores de WPBeginner.

Si necesitas ayuda para establecer tu sitio web, sigue paso a paso nuestra guía sobre cómo crear un sitio web.

Por último, necesitará un programa FTP y saber cómo utilizarlo para subir el sitio de su servidor local al sitio activo.

¿Preparado? Empecemos a migrar su sitio de WordPress.

Tutorial en vídeo

Subscribe to WPBeginner

Si prefiere instrucciones escritas, siga leyendo.

Método 1: Transferir WordPress del servidor local al sitio activo utilizando un plugin de migración (recomendado)

Este método es más fácil y recomendado para principiantes. Vamos a utilizar un plugin de migración de WordPress para mover WordPress desde localhost a un sitio en vivo.

Paso 1: Instalar y configurar el plugin Duplicator

En primer lugar, debe instalar y activar el plugin Duplicator en su sitio regional. Para más detalles, consulte nuestra guía paso a paso sobre cómo instalar un plugin de WordPress.

Consejo profesional: También hay una versión pro de Duplicator que ofrece copias de seguridad seguras, almacenamiento en la nube, restauración fácil del sitio y mucho más.

Para activarlo, debe ir a la página Duplicator ” Paquetes y hacer clic en el botón “Crear nuevo”.

Create new package for migration

Aparecerá una pantalla en la que podrá asignar un nombre a la copia de seguridad.

A continuación, haga clic en el botón “Siguiente”.

Name backup package

Duplicator realizará ahora algunas pruebas para ver si todo está en orden.

Si todos los elementos están marcados como “Bien”, haga clic en el botón “Construir”.

Build package

Este proceso puede tardar unos minutos, dependiendo del tamaño de su sitio web. Debe dejar esta pestaña abierta hasta que finalice el proceso.

Cuando termine, verá las opciones de descarga de los paquetes “Instalador” y “Archivo”. Haga clic en el enlace “Descarga con un solo clic” para descargar ambos archivos en su ordenador.

Download package files

El archivo “Archivo” es una copia completa de su sitio WordPress. Incluye todos los archivos del núcleo de WordPress, así como sus imágenes, subidas, temas, plugins y una copia de seguridad de su base de datos de WordPress.

El archivo “Instalador” es un script que automatizará todo el proceso de migración descomprimiendo el archivo que contiene su sitio web.

Paso 2: Crear una base de datos para su sitio web WordPress en vivo

Antes de que pueda ejecutar el instalador o subir el sitio web WordPress desde localhost a su servidor de alojamiento, necesita crear una base de datos MySQL para su nuevo sitio web en vivo.

Si ya ha creado una base de datos MySQL, puede omitir este paso.

Para crear una base de datos, debe visitar el Escritorio cPanel de su cuenta de alojamiento. A continuación, localice la sección “Bases de datos” y haga clic en el icono “Asistente para bases de datos MySQL”.

MySQL Database Wizard

En la pantalla siguiente, hay un campo para crear una nueva base de datos.

Sólo tiene que dar un nombre a su base de datos y hacer clic en el botón “Crear base de datos”.

Name new database

cPanel creará ahora una nueva base de datos para usted.

A continuación, introduzca un nombre de usuario y una contraseña para el nuevo usuario y haga clic en el botón “Crear usuario”.

Create new database user

A continuación, tienes que añadir a la base de datos el usuario que acabas de crear.

En primer lugar, haga clic en la casilla de verificación “Todos los privilegios”.

Check all privileges

A continuación, desplácese hacia abajo y haga clic en el botón “Realizar cambios” para guardar los cambios.

Su base de datos ya está lista para ser utilizada con su sitio WordPress. Asegúrese de anotar el nombre de la base de datos, el nombre de usuario y la contraseña. Necesitará esta información en el siguiente paso.

Paso 3: Subida de archivos desde el servidor local al sitio web de WordPress.

Ahora tiene que subir los archivos y el instalador de su sitio local a su cuenta de alojamiento.

En primer lugar, conéctese a su sitio activo utilizando un cliente FTP. Una vez conectado, asegúrese de que el directorio raíz de su sitio web está completamente vacío.

Normalmente, el directorio raíz es la carpeta /home/public_html/.

Algunas empresas de alojamiento de WordPress instalan WordPress automáticamente cuando te registras. Si tienes archivos de WordPress allí, entonces necesitas borrarlos.

Después, puede subir los archivos archive.zip e installer.php desde Duplicator a su directorio raíz vacío.

Upload archive and installer files

Paso 4: Ejecutar el script de migración

Una vez subidos los archivos de migración, visite la siguiente URL en su navegador / explorador:

http://example.com/installer.php

No olvide sustituir “ejemplo.com” por su propio nombre de dominio.

Se iniciará el asistente de migración de Duplicator.

El instalador realizará algunas pruebas e inicializará el script.

Duplicator migration wizard step 1

En la sección Configuración, se le pedirá que introduzca su alojamiento MySQL, el nombre de la base de datos, el nombre de usuario y la contraseña.

Su alojamiento será probablemente localhost. A continuación, introduzca los datos de la base de datos creada en el paso anterior.

A continuación, haga clic en el botón “Validar” para asegurarse de que los datos introducidos son correctos.

Validate settings

A continuación, haga clic en el botón “Siguiente” para continuar.

Duplicator importará la copia de seguridad de su base de datos de WordPress desde el archivo a su nueva base de datos.

También actualizará las URL que apuntan al sitio local a su nuevo sitio activo.

Ahora puede hacer clic en el botón ‘Admin Login’ para acceder al área de administrador de WordPress de su sitio.

Admin login

Una vez que acceda a su sitio activo, Duplicator limpiará automáticamente los archivos de instalación.

Eso es todo. Ha movido correctamente WordPress del servidor local a su sitio activo.

Método 2: Transferir manualmente WordPress del servidor local al sitio activo

En este método, le mostraremos cómo mover manualmente WordPress desde el servidor local a su sitio activo. Será útil si el primer método no funciona o si prefieres hacerlo manualmente.

Paso 1: Exportar la base de datos local de WordPress

Lo primero que tienes que hacer es exportar tu base de datos local de WordPress. Para ello utilizaremos phpMyAdmin.

Si no estás familiarizado con ella, entonces puede que quieras echar un vistazo a nuestra guía para la gestión de bases de datos de WordPress usando phpMyAdmin.

Sólo tienes que ir a http://localhost/phpmyadmin/ y hacer clic en tu base de datos de WordPress. A continuación, haz clic en el botón “Exportar” de la barra de menú superior.

Export from localhost

En la opción ‘Método de exportación:’, puede elegir ‘Rápido’ o ‘Personalizado’. Personalizado le proporcionará más opciones para exportar su base de datos.

Pero le recomendamos que elija “Rápido” y luego haga clic en el botón “Ir” para descargar su base de datos.

Export WordPress database using phpMyAdmin

Paso 2: Subida de archivos de WordPress al sitio activo

Ahora, tendremos que mover todos los archivos de su sitio web al sitio en vivo.

Para empezar, abra su cliente FTP y conéctese a su cuenta de alojamiento web.

Una vez conectado a tu sitio, asegúrate de subir los archivos al directorio correcto. Por ejemplo, si quieres que el sitio esté alojado en ‘tu_sitio.com’, entonces querrás subir todos los archivos a tu directorio public_html.

Ahora seleccione los archivos locales de WordPress y súbalos a su servidor.

Upload WordPress files FTP

Paso 3: Crear una base de datos MySQL en su sitio activo

Mientras tu cliente FTP está subiendo tus archivos de WordPress, puedes empezar a importar tu base de datos al servidor.

La mayoría de los proveedores de alojamiento de WordPress ofrecen cPanel para gestionar su cuenta de alojamiento, por lo que le mostraremos cómo crear una base de datos utilizando cPanel.

En primer lugar, debe acceder a su panel de control de cPanel y hacer clic en el icono “Asistente para bases de datos MySQL”, que se encuentra en la sección “Bases de datos”.

Select MySQL database wizard

En la pantalla siguiente, puede crear una nueva base de datos.

Introduzca un nombre para la base de datos y haga clic en “Crear base de datos”.

Name and create new database

cPanel creará automáticamente una nueva base de datos para usted.

A continuación, deberá introducir un nombre de usuario y una contraseña para su nuevo usuario y, a continuación, hacer clic en “Crear usuario”.

Create new database user

Después, tienes que añadir a la base de datos el usuario que acabas de crear.

En primer lugar, marque / compruebe la casilla de verificación “Todos los privilegios”.

Check all privileges checkbox

A continuación, desplázate hacia abajo y haz clic en “Realizar cambios” para guardarlos.

Ha creado correctamente una nueva base de datos para su sitio de WordPress.

Paso 4: Importar la base de datos de WordPress al sitio activo

El siguiente paso del proceso es importar su base de datos de WordPress.

Vaya a su Escritorio de cPanel, desplácese hasta la sección ‘Bases de datos’ y haga clic en ‘phpMyAdmin’.

Click on phpMyAdmin

Esto le llevará a phpMyAdmin, donde debe hacer clic en la base de datos que acaba de crear. phpMyAdmin mostrará su nueva base de datos sin tablas.

A continuación, haga clic en la pestaña “Importar” del menú superior. En la página de importación, haga clic en el botón “Elegir archivo” y seleccione el archivo de base de datos del sitio local que guardó en el primer paso.

Import database via phpMyAdmin

A continuación, haz clic en el botón “Ir” situado en la parte inferior de la página. Tu base de datos se importará automáticamente a phpMyadmin.

Paso 5: Cambiar la URL del sitio

Ahora, usted necesita cambiar la URL del sitio en su base de datos para que se conecte con su sitio de WordPress en vivo.

En phpMyAdmin, busque la tabla wp_options en la base de datos que acaba de importar.

Si ha cambiado el prefijo de su base de datos, entonces en lugar de wp_options, podría ser {new_prefix}_options.

A continuación, haga clic en el botón “Examinar” situado junto a wp_options. O bien, haga clic en el enlace en la barra lateral para abrir la página que tiene un anuncio / catálogo / ficha dentro de la tabla wp_options.

Browse the wp options table

A continuación, en la columna options_name, debe buscar la opción siteurl.

A continuación, haga clic en el icono “Editar”.

Edit siteurl in phpMyAdmin

Aparecerá una ventana en la que podrá editar el campo.

En la casilla option_value, verá la URL de su instalación local, que será algo así como http://localhost/test.

Debe introducir la URL de su nuevo sitio en este campo, por ejemplo: https: //www.wpbeginner.com.

A continuación, puede guardar el campo al hacer clic en el botón “Ir”.

edit the siteurl field

A continuación, debe seguir los mismos pasos anteriores para el nombre de la opción de inicio. El menú wp_options puede tener varias páginas. Normalmente, la opción de inicio estará en la segunda página.

A continuación, actualice la URL de inicio para que sea la misma que la URL de su sitio activo.

Paso 6: Establecer su sitio en vivo

Ahora que ha importado la base de datos y subido su contenido, es el momento de configurar WordPress.

En este momento, su sitio debería mostrar el error“Error al establecer una conexión con la base de datos“.

Para corregirlo, conéctese a su sitio web mediante un cliente FTP y abra el archivo wp-config.php.

Busque las siguientes líneas de código:

// ** MySQL settings - You can get this info from your web host ** //
/** The name of the database for WordPress */
define( 'DB_NAME', 'database_name_here' );
/** MySQL database username */
define( 'DB_USER', 'username_here' );
/** MySQL database password */
define( 'DB_PASSWORD', 'password_here' );
/** MySQL hostname */
define( 'DB_HOST', 'localhost' );

Deberá indicar el nombre de la base de datos, el nombre de usuario y la contraseña que creó anteriormente.

A continuación, guarde el archivo wp-config.php y vuelva a subirlo al servidor de alojamiento de WordPress.

Ahora, cuando visite su sitio web, debería estar en directo.

Después de eso, tienes que acceder a tu panel de administrador de WordPress e ir a Ajustes ” General. A continuación, sin cambiar nada, desplácese hasta la parte inferior y haga clic en el botón “Guardar cambios”.

Save general settings

Así se asegurará de que la URL de su sitio se corrige en cualquier otro lugar en el que deba estar.

Una vez hecho esto, vaya a Ajustes ” Enlaces permanentes, desplácese hacia abajo y haga clic en “Guardar cambios” para asegurarse de que todos los enlaces de las entradas funcionan correctamente.

Save permalinks settings

Siempre que traslade un sitio de WordPress de un dominio a otro o de un servidor local a un sitio activo, se encontrará con enlaces rotos e imágenes que faltan.

Una forma sencilla de actualizar las URL es mediante la siguiente consulta SQL:

UPDATE wp_posts SET post_content = REPLACE(post_content, 'localhost/test/', 'www.yourlivesite.com/');

Simplemente vaya a phpMyAdmin, haga clic en su base de datos y, a continuación, haga clic en “SQL” en el menú superior y añada la consulta anterior.

Asegúrese de cambiarla por la URL de su sitio local y de su sitio activo y haga clic en el botón “Ir”.

Fixing WordPress images and broken URLs after moving to live site

Ya está. Ha migrado correctamente WordPress de su servidor local a un sitio activo.

Esperamos que tu sitio web esté funcionando correctamente. Si comprueba algún error, puede marcar / comprobar nuestra guía de errores comunes de WordPress para ayudar a diagnosticar problemas.

Esperamos que este artículo te haya ayudado a trasladar WordPress de un servidor local a un sitio activo. Puede que también quieras ver nuestra guía sobre cómo crear un boletín de correo electrónico de la forma correcta o ver nuestra comparativa de las mejores alternativas de alojamiento de GoDaddy.

If you liked this article, then please subscribe to our YouTube Channel for WordPress video tutorials. You can also find us on Twitter and Facebook.

Descargo: Nuestro contenido está apoyado por los lectores. Esto significa que si hace clic en algunos de nuestros enlaces, podemos ganar una comisión. Vea cómo se financia WPBeginner , por qué es importante, y cómo puede apoyarnos. Aquí está nuestro proceso editorial .

Avatar

Editorial Staff at WPBeginner is a team of WordPress experts led by Syed Balkhi with over 16 years of experience in WordPress, Web Hosting, eCommerce, SEO, and Marketing. Started in 2009, WPBeginner is now the largest free WordPress resource site in the industry and is often referred to as the Wikipedia for WordPress.

El último kit de herramientas de WordPress

Obtenga acceso GRATUITO a nuestro kit de herramientas - una colección de productos y recursos relacionados con WordPress que todo profesional debería tener!

Reader Interactions

909 comentariosDeja una respuesta

  1. Syed Balkhi says

    Hey WPBeginner readers,
    Did you know you can win exciting prizes by commenting on WPBeginner?
    Every month, our top blog commenters will win HUGE rewards, including premium WordPress plugin licenses and cash prizes.
    You can get more details about the contest from here.
    Start sharing your thoughts below to stand a chance to win!

  2. sam says

    Isn’t it better to use a duplicator plugin instead of taking all this trouble as described in here
    or here
    I think using the duplicator is a easier. Feel free to add or correct me.

  3. fadilah says

    hi, i’m getting a problem with my permalink, my permalink is still pointed to my localhost something like fadil.dev so when i add a post/page, the permalink is pointed to my fadil.dev/?p=ID it should be pointed to fadil.com (my real domain) and not fadil.dev (my local domain) .. where i can find the configuration ? help me .. thankyou :)

  4. prox says

    nice tutorial i was thinking to do and found your website luckily and also i would like to ask two thing

    1. what’s this footer advertisement option is it a plugin ?

    2 what’s the plugin your using for newsletter i saw when i enter to your site there’s nice pop up banner that saying do you want to lean about WordPress and then enter your email address

    please share if you don’t mind

    thank you

  5. Nathan says

    Great help, thanks!

    One question, if I buy a theme, can I use it on both my local and live site even though they are different installations and thus have different WordPress id’s?

    I am building my first live site but I have set up a local to play with the designs and construct the content.

    Thanks.

  6. Matt says

    Hi. Firstly I’d like to thank you, this process was easy to understand and errorless on your end!

    My one hang-up was at the very end. I put in the SQL code in order to fix some linking errors, but must not have put the right local host because some small inconsistencies were not fixed. I have been using MAMP and accessing my site by going to “localhost:8888” Is this what I should put in that Step 7 code, or is there a different path?

    • WPBeginner Support says

      Matt first you need to make sure that inside your wp_posts table you are using localhost:8888 inside post content. If yes, then use this in the step 7. If you are seeing all your links as localhost, then use localhost.

      Administrador

  7. Dayomaks says

    All instructions works fine, thanks, i am so glad, but the issue i am having now is importing my database…while trying to import my database to a live server i got these errors below:

    Error
    SQL query:


    — Database: `soundmode`

    — ——————————————————–

    — Table structure for table `xs_commentmeta`

    CREATE TABLE IF NOT EXISTS `xs_commentmeta` (

    `meta_id` BIGINT( 20 ) UNSIGNED NOT NULL AUTO_INCREMENT ,
    `comment_id` BIGINT( 20 ) UNSIGNED NOT NULL DEFAULT ‘0’,
    `meta_key` VARCHAR( 255 ) DEFAULT NULL ,
    `meta_value` LONGTEXT,
    PRIMARY KEY ( `meta_id` ) ,
    KEY `comment_id` ( `comment_id` ) ,
    KEY `meta_key` ( `meta_key` )
    ) ENGINE = INNODB DEFAULT CHARSET = utf8 AUTO_INCREMENT =1;

    MySQL said: Documentation

    #1046 – No database selected

    ANY ASSISTANCE ON THERE?

  8. Christie Bellah says

    This worked great, thanks! In the past I had installed WordPress in the new hosting, dropped database tables, imported, etc. – this is so much faster and simpler.

  9. Stefano says

    First of all, thanks for the tutorial – invaluable and well written.

    Unfortunately, I managed to get stuck anyway.
    I uploaded everything via filezilla and phpmyadmin, and when i try to go to my domain it doesn’t show up any error. But nothing else, either.

    Just a blank page – which is weird, because by typing /wp-admin at the end of the url i DO have access to the wordpress control panel, and every page seems to be all right.

    Sorry to bother, but I really have no clue about what’s happening..
    Thanks in advance!

    • Stefano says

      Solved!
      Apparently, it had some issues with the theme loading.
      I couldn’t use the children theme i had worked on, but luckily I had changed just a couple of thing, so no big deal..

      • Stefano says

        I did, and in fact the url worked (even if it showed just a blank page).
        I still have no clue about what happened, but setting up the theme again solved it.
        Lucky shot =P

  10. sesan says

    please am having an error from step 4
    SQL query:


    — Database: `wordpress`

    CREATE DATABASE IF NOT EXISTS `wordpress` DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci;

    MySQL said: Documentation
    #1044 – Access denied for user ‘Admin7393’@’%’ to database ‘wordpress’

    • WPBeginner Support says

      Sesan, the export file prepared by phpmyadmin to import into your live site database, contains a line to check if a database exists if not then it tries to create it. To resolve this issue, you need to extract the zip archive you created. Inside it you will find a file with .sql extension. Open this file in a text editor like Notepad and then delete these lines

      CREATE DATABASE IF NOT EXISTS `wordpress` DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci;

      Below this line you will see another line like this

      USE `wordpress`;

      Replace wordpress with the name of the database you are trying to import into.

      Save your changes and put the sql file back into a zip archive (if it is too big, other wise you can also import it as it is).

      Administrador

  11. Tyler says

    Hi, thanks for the tutorial!

    I’m struggling with Step 2. Your tutorial shows several files/folders being uploaded whereas I only have wordpress.sql.gz from Step 1. I can’t seem to extract the file using any software but can open using a text editor.

    Any help would be greatly appreciated!

  12. Mario says

    do I need a cpanel to do this procedure? I am using a plugin to backup and export databases already, unfortunately the host provider that the client is using does not have a cpanel.

  13. Rhomy Prama Dhieka (Web Designer) says

    thanks for sharing.
    it help me alot migrating my wp website.
    would you mind if i translte this to my language, then i will put ur credit there ?
    thanks.

  14. ryan says

    hi, i am using stablehost and have used them before with WP websites. I followed all your steps and I am getting a parked page from my hosting provider…

    • WPBeginner Support says

      There can be several reasons for that. First make sure that you have installed WordPress in the root directory of your website. If you did then make a backup of your .htaccess file and delete the one from root directory of your website. If that doesn’t work, then find the default parked page files there might be an index.html file on your web server delete that file (Do Not delete index.php). If none of these help then contact your hosting provider.

      Administrador

  15. Alex says

    Thanks!

    I did a search for the ‘‹’ character in the extracted .sql file, but got an alert saying: The string ‘‹’ was not found.

    I don’t know if this matters, but I noticed that my local phpMyadmin version is 5.5.3, while my host’s phpMyadmin version is 3.5.8.2.

    Another note is that I had all my WordPress files already up on my public_html directory (which is your step 2) BEFORE exporting my local WordPress database (which is your step 1). I’m not sure if it makes a difference.

    I’ll try starting over with step 1, as you suggested, and if I get the same error then I may try the Duplicator plugin that you mentioned.

    Alex

  16. PatoPanichelli says

    You really helped me. This step by step is awesome, I had no problems migrating from MAMP to a live site. Thanks

  17. Alex says

    Thanks for the tutorial!

    Everything’s gone well until I get to the end of step 4. When I press the Go button at the bottom of the page, instead of having phpMyadmin import my WordPress database I get an error message that reads as follows:

    #1064 – You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ‘‹’ at line 1

    Can you let me know what you think may be causing this?

    Alex

    • WPBeginner Support says

      Alex, it seems like the database file you are trying to import has a character ‘‹’ which is not supposed to be there. You have two options to fix that, first option is go back to your localhost/phpmyadmin and export your local database again and then try to import it again. If the same error occurs again, then extract your database gzip file using 7zip program. Open the .sql file in a text editor like notepad and look at the first line. Also take a look at our database management using phpMyAdmin guide to learn more.

      Administrador

    • Anna says

      Make sure you clicked on the database name on the lefthand side that you’d like to import to. Make sure that is highlighted and then try again. (phpMyAdmin version 4.0.8).

  18. qs says

    I get this error when I import datebase into live site. How do i solve it?

    Error
    SQL query:

    /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;

    /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;

    /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;

    /*!40101 SET NAMES utf8 */;


    — Database: `wordpress`

    CREATE DATABASE IF NOT EXISTS `wordpress` DEFAULT CHARACTER SET latin1 COLLATE latin1_swedish_ci;

    MySQL said:

    #1044 – Access denied for user ‘bossaballsg’@’10.%’ to database ‘wordpress’

      • Chathuranga says

        Hi,

        Hope your DB name is “wordpress”

        Change the,
        – Database: `wordpress`

        CREATE DATABASE IF NOT EXISTS `wordpress` DEFAULT CHARACTER SET latin1 COLLATE latin1_swedish_ci;

        change “wordpress” to your live DB name. It’s at your sql file.

      • qs says

        I checked and all the privileges are already set to “yes”.

        is it because of the “latin1_swedish_ci” collation in my database? because the rest of the tables are all in “utf8_general_ci”

      • qs says

        I checked and all the privileges are already set to “yes”.

        is it because of the “latin1_swedish_ci” collation in my database? because the rest of the tables are all in “utf8_general_ci”

  19. fab says

    hi there,
    totally newbie here. hope you can help with this error message during step 4:
    Error
    SQL query:


    — Database: `information_schema`CREATE DATABASE `information_schema` DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci;
    MySQL said:

    #1044 – Access denied for user ‘renta730’@’localhost’ to database ‘information_schema’

    When setting this user I allowed all privileges to the database previously created (named “inicial”).
    Any thoughts?

    • WPBeginner Support says

      To change database username and password connect to your live website using an FTP client. Find wp-config.php file and edit it. You will see your database name, database username, and host information. Change it to the database information for your live site.

      Administrador

      • Kerry O'Connor says

        I’ve tried every variation of my ‘host url’ in the wp.config file and uploaded it every time, no avail, still getting ‘Error Establishing db..’

        Where before it was ‘localhost’, now it should be ‘mywebsite.com’, is that right?

        thanks

  20. Changdeo Mhaske says

    Thank You,

    would only make sense if this is a new site. If it is an existing site, then you would have to constantly comment out the hosts file in order to access the live site.

  21. Satyanarayana says

    Hi Dude.
    Actually i followed the process as you explaned above is very nice and clear.
    but i was getting the error “page not found”. when i click on link in a website
    i am changing my files from main server to localserver
    Can you please help

  22. Steve says

    As a beginner, I found this article very helpful, but couldn’t get my site up live after developing locally. Everything was fine until Step 6. I did see the Error Establishing Database Connection error, and then edited the wp-config.php file. However, my site became a blank screen at that stage and I haven’t been able to change it.

    I continued on and went to my WordPress admin panel, and checked Settings » General. They still showed the localhost web address so I changed it to my site url. This is when things turned ugly. I was automatically logged out of WordPress and can’t get back in. In fact, when I ask WordPress to email me a new password to log in, its sends a localhost URL that takes me to a sign-on page with a message that reads “Sorry, that key does not appear to be valid.” I have no idea what caused that.

    Any help would be greatly appreciated.

      • Steve says

        Thanks for your suggestion. I double-checked and yes I had completed that step. Both have the correct URL

        Part of my confusion is that I now have two databases for this website. I originally had one accessible through a URL that starts with the number of an IP Address/phpmyadmin. Then I have the one I created in Step 3, which I did through my hosting company’s e-panel. They have different passwords and names. But I’ve tried both combinations in the wp-config file and still get the blank screen. Which one of these databases should I be using? They seem to have identical content.

    • Patrick says

      Sparky!
      Your step-by-step guide was spot on. I am a mac user, and after MAMP, I am live now. Thanks a lot. It worked perfectly for me.
      Hat docked!

  23. Vishal Kumar says

    I have done migration form live site to localhost successfully. But I noticed that Comment facility is not there after this. I have also checked all the option in ‘Setting->Discussion’ page. Everything is cheked but Commenting option and Leave comment box is not visible anywhere in the localhost. Please give me any suggestion for this because I am new in wordpress I am a Zend framework developer basically.

  24. NARESH says

    Instead of moving the wordpress site, I would like to fresh install wordpress using fantastico or hostgator’s quick install, so will I be able to do like this too just by exporting and importing databases and uploading the themefiles? or this is the only way we can do it?

    I don’t know why. my local machine wordpress loads very slow than one, whichever is installed on live server using fantastico or quick install.

    • WPBeginner Support says

      Naresh yes you can import your posts and comments using import/export tools in WordPress, then you can upload theme and other files using FTP. There are multiple ways to do things you need to choose one that works best for you.

      Administrador

  25. Mark Jones says

    Do all of these instructions remain the same if there’s already an older, existing, non-wordpress page built where you want to move your wordpress page? For instance, rebuilding an existing site as a wordpress site, then switching over.

  26. Abrishca says

    It’s easy to forget just how much work a good plugin really does for us – I personally use the Duplicator plugin to transfer new websites from my development server to the client’s domain and you can see how much time this plugin (and Backup Buddy) can save you.

  27. Praveen says

    Hi,
    I am facing problem in changing the database after creating the new database.
    Is there any problem with my hosting service or anything else

  28. Anna says

    Are you reading my mind?! Just a little while back I sat down at the computer to figure out how to add a Facebook like button to my first website, currently in development. Whala! “How to add a Facebook like button to your posts” was that day’s article. Then I’m wondering how to begin the local to live migration today, and AGAIN, here’s this post! GET OUT OF MY HEAD! :)

    And seriously, thank you very much for the invaluable help you’ve given to a beginner like myself.

  29. riaz ali shah says

    great article, the technique i often use for develop wordpress sites for clients, i use dummy text and images for local and then i move my theme only on server.

  30. John Coleman says

    This was a great article. Another option to address the broken links issue is to do a find/replace on your .sql file (in a text editor) of the local URL to the production URL before you import it. This is also handy when moving a site to/from a sub-directory, or to push from staging (e.g. http://staging.domain.com) to production (e.g. http://www.domain.com).

    Thanks for putting this out there. I am sure it will help a lot of people.

  31. David says

    Could have used this article 20 months ago. The trick I discovered in making the move was to open the database file in a good text editor. From there I did a search & replace maneuver to change localhost to the proper URL. It discovered numerous instances without me tracking down the tables, or worrying if my command syntax was correct.

    There’s a plugin called Broken Link Checker that’s worth running as well after the move.

    There are some web-hosting sites who’s infrastructure keeps everything in your WordPress site as localhost. No need to change anything in your local build. Just copy it over. Will definitely chose one of them next time.

  32. Mark says

    2 suggestions to make it easier to move:

    1. When developing locally edit your HOSTS file (c:\Windows\System32\Drivers\etc\hosts) to point your domain name at local server. This avoids having to change the SITE URL and other links/images. Note: this will require config changes to your local web server.

    2. If you have to modify the SITE URL etc, after you have exported the local database and before import, Open the file in notepad and search for all instances of localhost/yourtestsite and replace with http://www.yourlivesite.com

    • Editorial Staff says

      Mark,

      1. would only make sense if this is a new site. If it is an existing site, then you would have to constantly comment out the hosts file in order to access the live site.

      2. Yes that would make sense.

      Administrador

  33. Gregg says

    I also recommend DeskTop Server which I have been using for more then a year. Desktop Server allows you to create a local version of your site and then direct deploy it. Awesome!

  34. Sü Smith says

    Great post! I typically just do find and replace on the .sql file with Notepad++ before uploading it to phpmyadmin. This is a nice alternative.

  35. Mike Ott says

    Unfortunately this only works for some sites. A lot of wordpress plugins store serialised data in the database (Gravity Forms is one such plugin), and serialised data isn’t portable so doing an SQL dump and importing via PHPMyAdmin won’t work properly because of the string length differences between your local URL and live domain. You can’t even run an SQL query over serialised data.

    The best thing I’ve found to get around this problem is by using the WP Migrate DB plugin (http://wordpress.org/plugins/wp-migrate-db/). It handles the serialised data problem flawlessly every time and you won’t have to do half the other things you mentioned in this post.

    Have fun.

  36. estudiowp says

    Nice article an well explained steps!

    However, many people will find troubles in their migrations because of the serialized data.

    Some plugins and themes use serialized data, and the replaces in step 5 and step 7 won´t change all the urls and paths that need to be changeed.

    For those steps you could use these tools or plugins:

    · wp migrate db plugin: http://wordpress.org/plugins/wp-migrate-db/

    · search and replace tool: http://interconnectit.com/products/search-and-replace-for-wordpress-databases/

    I hope this comment will be useful and sorry for my english!

  37. Jean says

    Great article – best I’ve read on this subject.

    I moved a site a while back and the only thing I would add is that you might need to re-save the permalinks settings. I had to do this because none of my menu links worked so this was an easy fix (luckily!)

    • Mike Ott says

      If anyone wants to know what that happens, it’s the .htaccess file shows a different RewriteRule between local and live.

      A quick edit to .htaccess fixes the problem or as Jean pointed out, re-saving the permalinks settings will also do the trick as it’s just fixing the RewriteRule.

Deja tu comentario

Gracias por elegir dejar un comentario. Tenga en cuenta que todos los comentarios son moderados de acuerdo con nuestros política de comentarios, y su dirección de correo electrónico NO será publicada. Por favor, NO utilice palabras clave en el campo de nombre. Tengamos una conversación personal y significativa.