How to find posts and pages in the backup - wordpress

I have backup of my site on my pc and i'm trying to find posts and pages (my site content) but i can't find them, in what folder in backup should i search in please?

Posts and Pages aren't stored as files in WordPress, they are stored in your database. If you open up your wp-config.php, you'll see what database tables/prefix your installation is using.
Depending on how you backed up your website, there may be a file (perhaps a .sql file, or .tar.gz file, or some proprietary file) somewhere, often in the base directory, or in the wp-content or wp-content/uploads directory. If you don't have a file like that somewhere, or just backed up the files straight from your hosting account (such as cPanel), you'll need to go back in there and download a backup of your database as well.
Also note that pages, posts, and other custom post types are stored in the wp_posts table, all together. If your site relies on custom fields, those will be stored in your wp_postmeta table.

Related

Moving backed up Wordpress from subdirectory to root

I have a question regarding moving a backup from http://websitename/subdirectory.com to http://websitename.com.
What is the best approach to do this?
I have the backup from the subdirectory on my pc and currently on the website root there is a clean Wordpress installation.
There are alot of pictures, the Avada theme there and other media files.
If I just copy the files via FTP will it crash or will the URLs be broken afterwards?
This will take a couple of steps to but here is the basic steps required.
Download the database from phpmyadmin (or however you access your sites database).
You should have a .sql file now.
You need to do a search and replace action on the full url for the site in the subfolder to the new location where it will live at the root. Your goal here is to get the subfolder out of every url on your site. Example, your current url is this: https://example.com/subfolder/ - you will need it to be https://example.com/
Save that version of your database as a new file called import.sql.
To be safe, I would create a new database, database user, and database password and import this new version into it. Store these values database name, database user, database password and database hostname. You will need them later.
Plugins
Download all of the plugins from /subfolder/wp-content/plugins/ folder and upload those to the /wp-content/plugins/ folder in your root level fresh install of wordpress.
Themes
Upload your theme to the /wp-content/themes/ folder from your /subfolder/wp-content/themes/ folder.
Uploads
Download everything in the /subfolder/wp-content/uploads/ folder and upload to the /wp-content/uploads/ folder.
Update your wp-config.php
That database that you created and imported your database in Step 1 here, you'll need to update your wp-config.php with the new database name, database user, database password and database host.
The last step here is to upload the wp-config.php to the root file and this will point the site to the new database.
Login to wp-admin
Login to wordpress at the root example.com/wp-admin/. Go to Permalinks settings and save them. Sometimes you have to do that to flush the permalinks and make subpages work.
Test your site
Go the frontend of your site and test everything to make sure that everything is in working order.

Can uploading public_html folder to another hosting service provider not be enough if the database wasn't backed up?

I had downloaded the whole public_html folder of wordpress of my website before moving to a new hosting provider. Meanwhile the old hosting is no longer available now. I was not aware that for the database one needs separate backup.
So does it mean that I can not have the full old website back if I only backedup the public_html folder?
Also can I still get something useful out of the public_html folder by uploading it to the new hosting or do I have to have a full start from scratch?
Wordpress stores all the text of your posts in the database, which also includes metadata about theme and plugin settings, etc. Theme files, plugin files, post images and other uploaded files are stored in the wp-content folder so you are good. You should backup your database before you migrate.
That said, you might be able to retrieve the text from the Internet Archive (https://archive.org/) if you are lucky. But that means you have to somehow manually get the posts back to the new database.
All your WordPress pages are stored in the database. If your database is gone or absent, I recommend you start all over. In your current situation, you can recover your theme.
It is also possible that the theme does not function properly if some of its setting where registered in the database.

wordpress website transfer from one machine to another

I installed wamp and wordpress locally. My friend also installed wamp and wordpress locally and started working on a website. I want him to send me what he finished so I can continue working on it. So he sent me his www folder inside wamp installation folder and I paste it inside my www folder. But when I open the website in browser it is empty (default one with Hello word). What should he send me, so I can continue working on the website?
If it's a wordpress website, it's not as easy as copy-paste; but it's not too difficult.
After they have given you all the physical files, your friend should
1) export their database (the name starts with wp_) using phpMyAdmin, and you should
2) import it with phpMyAdmin [note: if you want to overwrite your wordpress database, do this: 2a) as a backup, export your database with phpMyAdmin; and 2b) select all tables in your database and 'drop' them. Now the database is empty and you can import your friend's inside it.]
When this is done, you should
3) use phpMyAdmin to edit the first two entries in the table wp_options, inserting the proper path to your local website; then you should
4) assign to this database the username-password combination present in the wp-config.php file, in the main folder of wordpress. You do this with phpMyAdmin. Alternatively, you can edit wp-config.php so that it carries the proper password-username combination for your system.
IF there is nothing of interest in your friend's database (as posts, pages, themes or plugins settings that you need etc) then you can skip steps 1,2 and 3.
This should do it. :)
The content of your WordPress installation is stored in a mySQL database, not on the file system. The files your friend sent you is WordPress itself and doesn't change anything contentwise.
Your friend needs to export (dump) his database to a SQL file. This can be done with a tool like PhpMyAdmin or mySQL Workbench. Take this file and import (overwrite) your local database with it. Better make a backup of your database before!

Wp admin page isn't accessible

When I go to http://www.cowrubber.com/wp-admin
the url changes to
http://cowrubber.com/wp-admin/cowrubber.com/wp-login.php?redirect_to=http%3A%2F%2Fcowrubber.com%2Fwp-admin%2F&reauth=1
Somehow I just can't access the admin page to login.
I have copied the site from an test site on the localhost. And changed the url's in the database to the new ones but due to unknown reasons I just can't access the admin site.
When you move a wordpress to a differently named domain, it is not ehough to just search and replace in the database, because wordpress (sadly) store a lot of things in serveral table in serialized format.
So what you need to do is, in your case:
Create a backup of your local database.
Create a backup of your current production database and file.
Delete all the files from your production server, and drop all table from production database.
Copy all files to your production server from localhost.
Import the local database to production database.
Do not open the production wordpress site in the browser!
Go to here, and download the newest script: https://interconnectit.com/products/search-and-replace-for-wordpress-databases/
Unzip it into a wp_replace directory.
Upload this directory to your document root, where wp-conifg.php is.
Go to the http://example.com/wp_replace/
Fill the From and To fields, without http:// and without trailing slash. Eg: somethinog.localhost to 'example.com`
Live run it. You will see, how many records changed in wich tables.
Delete this wp_replace directory. If you leave it, add a htpasswd to it otherwise anybody can crash your db.
Go to the WP admin, navigate to Options -> Permalinks. Push save.
Now you can use your new domin :)

How to move Wordpress to another domain without the chance to make a proper backup first?

So my webhoster closed down, where I hosted my Wordpress blog. I was able to receive a zip file containing all my data. I now have a new webhoster and I extracted the zip file to its root directory.
Trying to open my website now gives me "Error establishing database connection". The web tells me it may be related to hardcoded urls in the Wordpress database, which I need to replace by the new url.
However the tutorials usually tell you to use the Wordpress interface to create a backup of my database first, which can then be edited in tools like phpmyadmin. I can not access the Wordpress interface anymore and so far did not manage to edit the database otherwise.
I tried placing a local copy of the blog in the "C:\xampp\htdocs" folder, hoping phpmyadmin would recognize the database and allow me to edit it. Not working, maybe I am doing something wrong?
Any ideas to revive my Wordpress blog?
Cheers
Okay I think I got it working. For people having the same issue:
I loaded the database locally by copying the *.myd, *.myi, *.frm files to a new folder in my local xampp installation (e.g. C:\xampp\mysql\data\myDatabase).
I then used phpmyadmin to export this database to a .sql file.
On my webserver I then installed a fresh wordpress blog. It might be enough to copy your existing wordpress stuff, without needing to do this step afterwards, not sure.
My webhost has phpmyadmin preinstalled, so I used that to delete the fresh wordpress databases and import the .sql file instead. Now everything is in place, but since I changed my domain I need to change the URL paths in the database.
I used this script (use it by placing it on your webserver in the wordpress root folder and calling it in the browser) to do a search&replace of my old url to the new url: https://interconnectit.com/products/search-and-replace-for-wordpress-databases/
After that I only had to manually fix the path to my header image that I had edited in the past in the theme's header.php file.
Phew. Thanks for your help f00644.

Resources