Moving a local wordpress site to another localhost - wordpress

I´m learning wordpress at home, so i created a site in my personal computer, in a localhost. Now i´m at work and i would like to continue my studies. So, yesterday in home i exported with the tools, all the things i did and copied the theme i created. I thought with this action it would be just an import thing but...not at all. Here i´m a wordpress site too, another site, and i would like just to add the one a did yesterday at home. Thanks

The data for wordpress is stored in a database (e.g. posts, user details, etc.), and the theme/ plugins in the wp-content folder.
This means that to create a new install you need to copy over the plugins, theme and database data (you can do this from the export tab in PHPMyAdmin; installed at localhost/PHPMyAdmin).

Related

Moving Wordpress Site from one Cpanel Account to Another

I can't find an answer to this particular question.
I have two cpanel accounts and I want to move my wordpress webiste from the original cpanel account to the new cpanel account.
I've tried downloading all the wordpress files and that didn't work. I've tried downloading all the files from the original site via WinSCP and that didn't work either.
I have been learning about and using various languages to create websites, etc. But I only know enough to be dangerous. So. The best answer would be one that's very literal to what steps I need to take using basic, regular-person English.
I hope someone can help!
Wordpress sites operate through a database so you can't simply copy files from one cPanel to another. There are a few different ways.
Method 1: Use a plugin
Create a fresh Wordpress on your new cPanel then use a migration plugin such as https://wordpress.org/plugins/duplicator/
Method 2: Do it manually
This is more complicated but I find it more reliable. The steps are as follows:
Download your Wordpress files
Use phpMyAdmin on your cPanel to export your wordpress database (SQL export) - https://www.hostinger.com/tutorials/export-mysql-database-with-phpmyadmin
If you are changing domains then you need to use a text editor on your SQL export to find and replace any instance of your old domain to your new one
Export your theme options (f you have them). There should be a theme option that says import/export and a long string to copy
Now you're ready to import
Upload your wordpress files to your new cPanel
Import your database in phpMyAdmin
Go to the home folder of your Wordpress install and edit the wp-config.php files to include your new database details (username, password, database name)
Login to Wordpress and import your theme options by copying the long string from point 4 into the import box (if you have options)
You should be done
Before doing any kind of migration make sure you have a back-up of your Wordpress site

Changing Wordpress Theme in Staging Environment

I have a live newspaper WordPress website with about 10 users updating it daily with about 2000+ unique visitors a day. I have a sum of about 30 posts a day added to my db and i host my own pictures.
My goal is to change my theme that has been used for over 4 years so smoothly that I don't experience much hiccup for my viewers.
I want a dev environment somewhere in my server that I can test my new theme with my current posts.
A solution I have in my head is to create a subdomain for example "dev.example.com" and deploy the new theme there and have two working wordpress themes with one database.
Is this even possible? I need to have my new theme that is in a dev environment have access to my live database.
What is the best practice for this situation?
for people looking into this like me, I will post my findings below and if you like you can comment to guide me or tell me what I'm doing wrong or right.
there is a wp-staging plugin that can be used but it seems to be paid if you want to push changes from staging version to production version of your website.
I have also figured out that another wp website can be installed on a subdomain that you can create through cpanel and install a brand new wordpress environment that is completely separate from your live site with its own db and config.
Since most of us don't have unlimited server resources its going to be pretty heavy to clone everything from live site to staging site and I figured they cant share a db because changes made to staging site can effect live site if they share a database.
So I looked over a very well summarized easy youtube video which basically explained the whole process for cloning your wordpress on your subdomain and using a new db, but this solution can be good if you have the server space and resources, for a website like mine i would guess that a local installation of wordpress would work.
One of the comments on that video was very usefull as well:
Just create a subdomain, install WordPress with Softaculous on the subdomain, install the All In One WP Migration Plugin on both the main site and the subdomain, export the file in All In One WP Migration on the main site and import it to the subdomain and vice versa, you have your staging.

how to export wordpress pages,posts with media for another site

I have wordpress site i need to export posts , pages with media and attachments engaged with them.
and need to use it in another wordpress site.
Also i have installed the woocommerce in it , i need to export the store settings, products, categories , tags with images used for it...
There are many custom post types used in my site. i need to also export theme with medias used...
I tried using Tools -> Import / Export but that does not exports the data with media or images.
Need an immediate help..
Thanks
I just found out how to do this today, and answered this question with a great guide with photos on how to use the export and import tools in WordPress to transfer photos to a new site to be used in posts and pages. This is done by editing the xml files to show the correctly transferred image URLs.
Since I can't post photos because of my reputation, here is the link.
https://wordpress.stackexchange.com/questions/117344/failed-to-import-media/372304#372304
I have wordpress site i need to export posts , pages with media and attachments engaged with them. and need to use it in another wordpress site.
Also i have installed the woocommerce in it , i need to export the store settings, products, categories , tags with images used for it...
There are many custom post types used in my site. i need to also export theme with medias used...
I don't think so you had left something un-neccessary, So Download the database and import it wherever your new database you want to store.
Then download the wp-content/themes, wp-content/uploads, wp-content/plugins Directories. OR Simply Download your wp-content directory. Now you have everything.
I have Everything Now?
Now download the wordpress from wordpress.org and install it to your server. After complete the Installation, Replace the wp-content directory with your new installed wordpress. We assigned our old stuff to New Wordpress.
Now its time to replace Database. There are several online tutorials to replace your old database to new one.
There are multiple ways you can do this:
Manual
Using plugin
For manual, it's a little more lengthy process, you need to download complete files from one server and upload it to another. Do some changes to the backup DB i.e replacing urls and then uploading the DB file as well.
Other way, which is far more better is to use the plugin called as "All in one Migration". Here is the link which can guide you on the complete process:
https://makersbyte.com/easily-export-import-wordpress-sites/
Exporting your WordPress site can be used for site moves or simple backups. In this guide, I’ll provide some simple and easy options to export your WordPress sites for both non-technical and technical people.
Exporting your site creates a backup of your site, usually in the form of a .tar.gz or .zip file, which you can then use to restore or migrate your site to another domain or host. Once you have the backup it’s an easy matter loading a blank WordPress site, loading the plugin, and then restoring the site from your backup file.
When you export your WordPress sites you have the choice to export all your posts, pages, comments, custom fields, terms, navigation menus, and custom posts but the downside to this approach and it’s that WordPress doesn’t export plugins, theme, and settings of your site.
Export Site
1. Log into WordPress
2. Go to Tools > Export
3. Choose what you want to export:
-All
-Posts
-Pages
-Media
4. Click Download Export File. This will download a .xml file to your computer.
Import Site
1. Log in to the WordPress site you want to import it to.
2. Go to Tools > Import.
3. Find the option called WordPress at the bottom and click Install
Now.
4. When it’s finished installing, click Run Importer.
5. Upload the .xml file you exported.
Once you’ve completed exporting your site, you will want to test everything on the site. Make sure that you look for dead links, check menus, and any functionality or post that you consider important to your website.
It doesn’t have to be hard to export your WordPress sites. There are options for everyone, no matter what level of technical skill you have. And should you ever encounter a conflict, hack, or choose to move your site, having an export of your site is invaluable.

After WordPress export/import, the blog sometimes loads an empty page

I'm talking about http://henrich.ro
Recently I've changed the hosting. It's a WordPress blog. I copied the files through FTP, then exported the database from the old hosting via the WordPress admin panel and imported on the new hosting.
The blog sometimes loads an empty blank page, a fast load, without any error on the log files.
It is because i just copied the files and haven't installed a new wordpress before imported the database and files? I avoided this because I have lots of plugins installed with particular settings.
Any idea?
Here is the documentation for switching hosts with Wordpress. It has a step by step list of things to check.

How to back up wordpress site to be restored after a clean installation

My Wordpress blog appears to have been hacked and now blogs do not save and any changes I make such as approving a comment do not have effect. I am trying to backup my website so as to uninstall wordpress and perform a clean re-instillation. I want to create a backup so that when i restore the website will appear with everything the same as before: posts, images, links, colors, comments, themes, pages, etc. I have already backed up the MySQL database successfully. How do i backup the rest of the site.
Please tell me how to backup the site and also how to restore the site.
Thanks
You need to backup both your database and your Wordpress installation. The main resource to use for this is the Wordpress site:
http://codex.wordpress.org/WordPress_Backups
If you have phpmyadmin installed you can do a database dump from ther. If you don't have this installed then use mysqldump.
Wordpress installation backup can be initiated through the following URL:
http://[yourwordpressurl]/wp-admin/export.php
That will contain "your posts, pages, comments, custom fields, categories, and tags".
These links should get you started:
http://www.geeksaresexy.net/2008/01/29/how-to-backup-and-restore-your-wordpress-blog/
http://www.siteground.com/tutorials/wordpress/wordpress_backup.htm
http://codex.wordpress.org/WordPress_Backups
Good idea to look at FAQ: My site was hacked « WordPress Codex and How to Completely Clean a Hacked Wordpress Install.
best thing to do is to manually copy the database, as wordpress restore has an upload limit on the built in restore function. so if you've been blogging for a while, this can be really bad.
mysqldump -u yourUsername -p yourDatabaseName > databaseName.sql
will create the file databaseName.sql this is a full clone of all your database info (all your posts & wordpress configs)
then you can restore later with
mysql -u yourUsername -p yourDatabaseName < databaseName.sql
I figured it out. One way to cleanly install a new version of Wordpress but not lose your website is the use the Wordpress export feature as mentioned by Jon.
http://codex.wordpress.org/Tools_Export_SubPanel
This exports your blog to an XML file that contains all content of your site: posts, comments, authors, pages, etc. However, images do not go with. However when importing this XML file there is an option to download and import the attachments automatically which can be done if the original site is still online. So what I did is export my XML file, upload it to a wordpress blog installed on a subdomain automatically getting the attachments, then export an XML file from the subdomain to import into the actual wordpress site. This way my attachments were simply moved around from site to subdomain back to site. This made it easy because I did not have to handle backing up my attachments manually.
So what I did was back up my theme, export my blog to XML, then delete wordpress and my database then reinstall it with a new database on both my site and a subdomain of my site.
Then I imported my XML file and put my theme in the themes folder of the subdomain. Then I exported an XML file of this subdomain copy of my site and imported it into my real site. This made my blog have all the content correct and the theme right but none of the links, plugins, or colors correct. I then had to customize wordpress through the panel to get it back to the look and feel it was. For this It was lucky I had a stored copy of the site to refer to.
This process was long because I actually had to rebuild my site twice, one for the subdomain and then again for the actual thing. But it fixed my problems.
You can simply use EverLive.net. No need to install any plugin. No need for shell access. With this service you can simply make your wordpress website backup to the cloud. One-click restore option is also available wheneven you need to restore.

Resources