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

Como mover o WordPress do servidor local para o site ativo (2 métodos)

Nota editorial: Ganhamos uma comissão de links de parceiros no WPBeginner. As comissões não afetam as opiniões ou avaliações de nossos editores. Saiba mais sobre Processo editorial.

Muitos usuários do WordPress preferem trabalhar em seus sites usando um servidor local em seus computadores antes de transferi-los para um servidor de hospedagem ao vivo.

Ele permite que você trabalhe em seu site de forma privada antes de disponibilizar essas alterações on-line.

Eventualmente, você precisará movê-lo para um servidor ativo para disponibilizá-lo aos visitantes on-line.

Neste artigo, mostraremos instruções passo a passo sobre como mover o WordPress de um servidor local para um site ativo.

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

Por que mover o WordPress de um servidor local para um site ativo?

Criar seu blog WordPress em um servidor local é uma maneira segura de testar as alterações em seu site sem afetar os visitantes.

Quando você terminar de aperfeiçoar seu site, a próxima etapa é passar do servidor local para um site ativo.

Vamos mostrar duas maneiras de mover seu site de um servidor local para um site ativo.

O primeiro método usa um plug-in de migração do WordPress e é recomendado para iniciantes.

No segundo método, mostraremos como mover manualmente o WordPress de um servidor local para um site ativo.

Você pode escolher o método que funciona melhor para você:

Antes de migrar seu site WordPress

Para migrar o WordPress de um servidor local para um servidor ativo, você precisa ter alguns aspectos em vigor.

Primeiro, supomos que você tenha um site WordPress em execução em um servidor local (também chamado de localhost) no seu computador e que tenha acesso total a ele.

Em seguida, você precisará ter um nome de domínio e uma hospedagem na Web.

Para facilitar sua decisão, recomendamos o uso da Bluehost. Eles são uma empresa de hospedagem WordPress oficialmente recomendada e estão oferecendo aos usuários do WPBeginner um desconto exclusivo + domínio e SSL gratuitos.

Basicamente, você pode começar por apenas US$ 1,99 por mês.

Se você quiser uma ótima alternativa ao Bluehost, pode dar uma olhada no Hostinger. Eles também estão oferecendo um desconto exclusivo para usuários do WPBeginner com um nome de domínio gratuito.

Se você puder pagar um pouco mais, dê uma olhada no SiteGround. Eles também têm uma oferta especial para os leitores do WPBeginner.

Se precisar de ajuda para configurar seu site, siga nosso guia passo a passo sobre como criar um site.

Por fim, você precisará de um programa de FTP e saberá como usar o FTP para fazer upload do site do servidor local para o site ativo.

Pronto? Vamos começar a migrar seu site WordPress.

Tutorial em vídeo

Subscribe to WPBeginner

Se você preferir instruções por escrito, continue lendo.

Método 1: Transferir o WordPress do servidor local para o site ativo usando um plug-in de migração (recomendado)

Esse método é mais fácil e recomendado para iniciantes. Usaremos um plugin de migração do WordPress para mover o WordPress do host local para um site ativo.

Etapa 1: Instalar e configurar o plug-in do Duplicator

Primeiro, você precisa instalar e ativar o plug-in do Duplicator em seu site local. Para obter mais detalhes, consulte nosso guia passo a passo sobre como instalar um plug-in do WordPress.

Dica profissional: Há também uma versão profissional do Duplicator que oferece backups seguros, armazenamento em nuvem, restauração fácil do site e muito mais.

Após a ativação, você precisa ir para a página Duplicator ” Packages (Pacotes ) e clicar no botão “Create New” (Criar novo).

Create new package for migration

Isso o levará a uma tela na qual você poderá dar um nome ao backup.

Em seguida, clique no botão “Next” (Avançar).

Name backup package

O Duplicator agora executará alguns testes para verificar se tudo está em ordem.

Se todos os itens estiverem marcados como “Bom”, clique no botão “Construir”.

Build package

Esse processo pode levar alguns minutos, dependendo do tamanho de seu site. Você precisa deixar essa guia aberta até que o processo seja concluído.

Quando terminar, você verá opções de download para os pacotes “Installer” e “Archive”. Você precisa clicar no link “One-Click Download” para baixar os dois arquivos para o seu computador.

Download package files

O arquivo “Archive” é uma cópia completa do seu site WordPress. Ele inclui todos os arquivos principais do WordPress, bem como suas imagens, uploads, temas, plug-ins e um backup do seu banco de dados do WordPress.

O arquivo “Installer” é um script que automatizará todo o processo de migração, descompactando o arquivo que contém seu site.

Etapa 2: Crie um banco de dados para seu site WordPress ativo

Antes de executar o instalador ou carregar o site do WordPress do host local para o servidor de hospedagem, é necessário criar um banco de dados MySQL para o novo site ativo.

Se você já tiver criado um banco de dados MySQL, poderá pular esta etapa.

Para criar um banco de dados, você precisa acessar o painel do cPanel da sua conta de hospedagem. Em seguida, localize a seção “Databases” (Bancos de dados) e clique no ícone “MySQL Database Wizard” (Assistente de banco de dados MySQL).

MySQL Database Wizard

Na tela seguinte, há um campo para criar um novo banco de dados.

Basta fornecer um nome para o seu banco de dados e clicar no botão “Create Database” (Criar banco de dados).

Name new database

O cPanel criará um novo banco de dados para você.

Depois disso, é necessário inserir um nome de usuário e uma senha para o novo usuário e, em seguida, clicar no botão “Create User” (Criar usuário).

Create new database user

Em seguida, você precisa adicionar o usuário que acabou de criar ao banco de dados.

Primeiro, clique na caixa de seleção “All Privileges” (Todos os privilégios).

Check all privileges

Em seguida, role a tela para baixo e clique no botão “Make Changes” (Fazer alterações) para salvar suas alterações.

Seu banco de dados está pronto para ser usado com seu site WordPress. Não se esqueça de anotar o nome do banco de dados, o nome de usuário e a senha. Você precisará dessas informações na próxima etapa.

Etapa 3: Fazer upload de arquivos do servidor local para o site WordPress ativo

Agora, você precisa carregar o arquivo e os arquivos do instalador do seu site local para a sua conta de hospedagem.

Primeiro, conecte-se ao seu site ativo usando um cliente FTP. Uma vez conectado, certifique-se de que o diretório raiz de seu site esteja completamente vazio.

Normalmente, o diretório raiz é a pasta /home/public_html/.

Algumas empresas de hospedagem WordPress instalam automaticamente o WordPress quando você se inscreve. Se você tiver arquivos do WordPress lá, precisará excluí-los.

Depois disso, você pode carregar os arquivos archive.zip e installer.php do Duplicator para seu diretório raiz vazio.

Upload archive and installer files

Etapa 4: Execução do script de migração

Depois de fazer o upload dos arquivos de migração, você precisa visitar o seguinte URL no navegador:

http://example.com/installer.php

Não se esqueça de substituir “example.com” por seu próprio nome de domínio.

Isso iniciará o assistente de migração do Duplicator.

O instalador executará alguns testes e inicializará o script.

Duplicator migration wizard step 1

Na seção Setup (Configuração), você será solicitado a inserir o host do MySQL, o nome do banco de dados, o nome de usuário e a senha.

Seu host provavelmente será localhost. Depois disso, você digitará os detalhes do banco de dados que criou na etapa anterior.

Em seguida, clique no botão “Validate” (Validar) para garantir que os detalhes inseridos estejam corretos.

Validate settings

Depois disso, clique no botão “Next” (Avançar) para continuar.

O Duplicator agora importará o backup do banco de dados do WordPress do arquivo para o novo banco de dados.

Ele também atualizará os URLs que apontam para o site local para seu novo site ativo.

Agora você pode clicar no botão “Admin Login” para entrar na área de administração do WordPress do seu site ativo.

Admin login

Quando você fizer login no site ativo, o Duplicator limpará automaticamente os arquivos de instalação.

Isso é tudo. Você transferiu com êxito o WordPress do servidor local para o site ativo.

Método 2: Transferir manualmente o WordPress do servidor local para o site ativo

Neste método, mostraremos como mover manualmente o WordPress do servidor local para seu site ativo. Ele será útil se o primeiro método não funcionar ou se você preferir fazer isso manualmente.

Etapa 1: Exportar o banco de dados local do WordPress

A primeira coisa que você precisa fazer é exportar seu banco de dados local do WordPress. Usaremos o phpMyAdmin para fazer isso.

Se não estiver familiarizado com ele, talvez queira dar uma olhada em nosso guia sobre gerenciamento de banco de dados do WordPress usando o phpMyAdmin.

Basta acessar http://localhost/phpmyadmin/ e clicar em seu banco de dados do WordPress. Em seguida, clique no botão “Export” na barra de menu superior.

Export from localhost

Na opção “Export method:” (Método de exportação), você pode escolher “Quick” (Rápido) ou “Custom” (Personalizado). A opção Personalizada lhe dará mais opções para exportar seu banco de dados.

Mas recomendamos escolher “Quick” (Rápido) e clicar no botão “Go” (Ir) para fazer o download do banco de dados.

Export WordPress database using phpMyAdmin

Etapa 2: Faça upload dos arquivos do WordPress para o site ativo

Agora, precisaremos mover todos os arquivos do seu site para o site ativo.

Para começar, abra seu cliente FTP e conecte-se à sua conta de hospedagem na Web.

Depois de se conectar ao seu site ativo, certifique-se de carregar os arquivos no diretório correto. Por exemplo, se você quiser que o site seja hospedado em “yoursite.com”, deverá carregar todos os arquivos no diretório public_html.

Agora, selecione seus arquivos locais do WordPress e carregue-os no servidor ativo.

Upload WordPress files FTP

Etapa 3: Crie um banco de dados MySQL em seu site ativo

Enquanto o cliente FTP estiver carregando os arquivos do WordPress, você poderá começar a importar o banco de dados para o servidor ativo.

A maioria dos provedores de hospedagem WordPress oferece o cPanel para gerenciar sua conta de hospedagem, portanto, mostraremos como criar um banco de dados usando o cPanel.

Primeiro, é necessário fazer login no painel do cPanel e clicar no ícone “MySQL Database Wizard” (Assistente de banco de dados MySQL), que pode ser encontrado na seção “Databases” (Bancos de dados).

Select MySQL database wizard

Na tela seguinte, você pode criar um novo banco de dados.

Você precisa fornecer um nome para o banco de dados e, em seguida, clicar em “Create Database” (Criar banco de dados).

Name and create new database

O cPanel criará automaticamente um novo banco de dados para você.

Em seguida, é necessário inserir um nome de usuário e uma senha para o novo usuário e clicar em “Create User” (Criar usuário).

Create new database user

Depois disso, você precisa adicionar o usuário que acabou de criar ao banco de dados.

Primeiro, marque a caixa de seleção “All Privileges” (Todos os privilégios).

Check all privileges checkbox

Em seguida, role a tela para baixo e clique em “Make Changes” (Fazer alterações) para salvar suas alterações.

Você criou com sucesso um novo banco de dados para seu site WordPress ativo.

Etapa 4: Importar o banco de dados do WordPress para o site ativo

A próxima etapa do processo é importar seu banco de dados do WordPress.

Vá para o painel do cPanel, role para baixo até a seção “Databases” (Bancos de dados) e clique em “phpMyAdmin”.

Click on phpMyAdmin

Isso o levará ao phpMyAdmin, onde você deverá clicar no banco de dados que acabou de criar acima. O phpMyAdmin mostrará seu novo banco de dados sem tabelas.

Em seguida, clique na guia “Import” (Importar) no menu superior. Na página de importação, clique no botão “Choose File” (Escolher arquivo) e selecione o arquivo de banco de dados do site local que você salvou na primeira etapa.

Import database via phpMyAdmin

Depois disso, clique no botão “Go” (Ir) na parte inferior da página. Seu banco de dados será importado automaticamente para o phpMyadmin.

Etapa 5: Alterar o URL do site

Agora, você precisa alterar o URL do site no banco de dados para que ele se conecte ao seu site WordPress ativo.

No phpMyAdmin, procure a tabela wp_options em seu banco de dados que você acabou de importar acima.

Se você alterou o prefixo do banco de dados, em vez de wp_options, pode ser {new_prefix}_options.

Em seguida, clique no botão “Browse” (Procurar) ao lado de wp_options. Ou clique no link na barra lateral para abrir a página que tem uma lista de campos na tabela wp_options.

Browse the wp options table

Em seguida, na coluna options_name, você precisa procurar a opção siteurl.

Em seguida, clique no ícone “Editar”.

Edit siteurl in phpMyAdmin

Isso abre uma janela na qual você pode editar o campo.

Na caixa de entrada para option_value, você verá o URL da sua instalação local, que será algo como http://localhost/test.

Você precisa inserir o URL do novo site nesse campo, por exemplo: https://www.wpbeginner.com.

Em seguida, você pode salvar o campo clicando no botão “Go” (Ir).

edit the siteurl field

Em seguida, você precisa seguir as mesmas etapas descritas acima para o nome da opção home. O menu wp_options pode ter algumas páginas. Normalmente, a opção home estará na segunda página.

Em seguida, atualize o URL da página inicial para que ele seja igual ao URL do site ativo.

Etapa 6: Configure seu site ativo

Agora que você importou o banco de dados e fez o upload do conteúdo, é hora de configurar o WordPress.

Nesse momento, seu site deve estar exibindo o erro“Erro ao estabelecer uma conexão com o banco de dados“.

Para corrigir isso, conecte-se ao seu site usando um cliente FTP e abra o arquivo wp-config.php.

Você procurará as seguintes linhas 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' );

Você precisará fornecer o nome do banco de dados, o nome de usuário e a senha que criou anteriormente.

Em seguida, salve o arquivo wp-config.php e carregue-o novamente no servidor de hospedagem do WordPress.

Agora, quando você acessar seu site, ele deverá estar ativo.

Depois disso, você precisa fazer login no painel de administração do WordPress e ir para Configurações ” Geral. Em seguida, sem alterar nada, role até a parte inferior e clique no botão “Salvar alterações”.

Save general settings

Isso garantirá que o URL do seu site seja corrigido em qualquer outro lugar que seja necessário.

Depois de fazer isso, vá para Configurações ” Permalinks, role para baixo e clique em “Salvar alterações” para garantir que todos os links de postagem estejam funcionando bem.

Save permalinks settings

Sempre que estiver movendo um site do WordPress de um domínio para outro ou de um servidor local para um site ativo, você se deparará com links quebrados e imagens ausentes.

Uma maneira simples de atualizar os URLs é usar a seguinte consulta SQL:

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

Basta acessar o phpMyAdmin, clicar em seu banco de dados e, em seguida, clicar em “SQL” no menu superior e adicionar a consulta acima.

Certifique-se de alterá-lo para os URLs do seu próprio site local e do site ativo e clique no botão “Go” (Ir).

Fixing WordPress images and broken URLs after moving to live site

É isso aí. Agora você migrou com sucesso o WordPress do seu servidor local para um site ativo.

Esperamos que seu site ativo esteja funcionando sem problemas. Se você notar algum erro, consulte nosso guia de erros comuns do WordPress para obter ajuda na solução de problemas.

Esperamos que este artigo tenha ajudado você a mover o WordPress de um servidor local para um site ativo. Talvez você também queira ver nosso guia sobre como criar um boletim informativo por e-mail da maneira correta ou ver nossa comparação das melhores alternativas de hospedagem da GoDaddy.

Se você gostou deste artigo, inscreva-se em nosso canal do YouTube para receber tutoriais em vídeo sobre o WordPress. Você também pode nos encontrar no Twitter e no Facebook.

Divulgação: Nosso conteúdo é apoiado pelo leitor. Isso significa que, se você clicar em alguns de nossos links, poderemos receber uma comissão. Veja como o WPBeginner é financiado, por que isso é importante e como você pode nos apoiar. Aqui está nosso processo 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.

O kit de ferramentas definitivo WordPress

Obtenha acesso GRATUITO ao nosso kit de ferramentas - uma coleção de produtos e recursos relacionados ao WordPress que todo profissional deve ter!

Reader Interactions

909 ComentáriosDeixe uma resposta

  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.

Deixe uma resposta

Obrigado por deixar um comentário. Lembre-se de que todos os comentários são moderados de acordo com nossos política de comentários, e seu endereço de e-mail NÃO será publicado. NÃO use palavras-chave no campo do nome. Vamos ter uma conversa pessoal e significativa.