Restore wordpress from local copy - wordpress

I have a local wordpress backup which is a copy of the main dir from the previous webhost.
I runned the site using wampserver but when I tried to open the index page it said: "Error establishing a database connection".
I think this is because the database is not imported in phpMyAdmin. How can I make this work so I can access the site?

The WordPress database stores all of the site content - Posts, Pages, custom post types, images, and so forth. Unless you have a copy of the database, the files you have will only be useful for setting up the same plugins and theme that were being used on the old host.
There may be a couple of ways to restore your lost content:
Check Wayback Machine - if it's a larger site it may be indexed here, and you can go through page by page and rebuild.
Check Google's cache - if the site was only recently removed from the old webhost, the individual pages may be cached for a time. It would be wise to download as "complete webpage" each page and then go through page by page and rebuild. Same with images - if they've only recently been removed, you may be able to find (possibly lower-resolution) cached versions and download them. To check, do a Google search for site:http://example.com (replace with your URL).
If neither of these exist, you'll need to start from scratch on the content, but you'll have learned a valuable lesson about backing up. :)

Related

Wordpress Toolkit (Plesk) detects two sites on my domain when there is only one (+ strange ghosting effect...)

Context
Hi, I recently created a new wordpress site for one of my clients. I first created it in a subdomain of the target domain. before dragging it to the target directory via FTP. Once finished, I moved the content of the old site file (a prestashop) from the root (httpdocs) to another file on the server, then I finally dragged the new wordpress site before on this same root (httpdocs). All this was done via FTP. All this was done via FTP, but I had to restart the moves several times.
Problem
Wordpress Toolkit now detects two Wordpress sites (see 1 2) on the main domain and I observe some really strange behaviors, for example :
When I delete one of the two sites via the Toolkit, it then automatically returns to the list
Both sites have exactly the same data (status, plug-ins, databases, ...) in the Toolkit
Some changes made on Wordpress actually appear on the page in question, but when reloading, they go away, then come back, as if there were actually two sites that overlapped: one that is affected by the changes and the other that remains unchanged and that are randomly chosen to be displayed on my browser.
Another finding that supports this is that when I log out of the WordPress admin console, and then return to the site as a visitor, the admin banner is still there at the top of the page, proving that I am still logged in
So I don't know if it's a problem with the configuration of WordPress files like .htaccess/wp-config or if other files were corrupted by the FTP moves or even both cases. It seems to me that there is only one Wordpress in my httpdocs and I don't really know where to look...
I deleted all the files from the server, having first uploaded the folder containing my wordpress via FTP. I then recreated httpdocs again then uploaded the site, some files were no longer present and created some 404, I added them by hand based on an old version of the site that I had in backup.

Wordpress: pages are not updating despite emptying caches

I have used the plugin All-in-One WP Migration to get the site from the development environment to the live site (you can export and import a complete website).
Some pages have updated correctly but not all of the pages (they remain in the old style and structure).
I have deleted my browser cache several times (tried several browsers on different computers even), deleted caches created by plugins several times (tried deactivating those plugins as well). However, despite trying to delete all the caches I can think of, some pages are just not updating. As the page templates for these pages do not exist anymore on the server, I am at a complete loss as to what's preventing all the pages from updating correctly.
What am I missing?
May I ask is your site already live? Cause I had the same issue as yours and I manage to get it updated by deleting the cache by "Flush Cache" on my WordPress admin page
Once you logged in to your WordPress admin site you'll find this and click that
Flush Cache
Flush Cache (2)
I am not so sure why that happens but I am thinking it might be because from the server and might need sometime on updating any changes made. It happened to me also when I have some updates on my site then once I save everything and go to my site, still the old ones are being shown but when I Flush Cache then it shows up the new ones... I think the reason because it still shows up the old ones is probably of the cache from the old ones in the server and by flushing them is being able to show the updated ones.

wordpress edit theme offline

I have a Wordpress-theme-based web published on the net, uploaded in a hosting.
I have to edit/simplify/modify the whole page, offline, on local for example.
While I make the changes offline, the page (an online magazine) has to keep online, as it is, until I publish the new version.
I have to be able to show the changes online, without affecting the original until the end.
What is a good way to do the whole process? Thank you very much.
Make offline server by installing eg. XAMPP.
Copy files, and export database from online to local,
Modify wp-config.php to match local database settings
Modify theme offline
Upload theme to online FTP when work is done
Make sure if changes you made are only in wp-content/themes/theme_name files - not in database content. If not, you will have to sync databases.
You can make the same to work online by cloning your WP to eg. subdomain, then protect it by htpasswd, to prevent unauthorised access.
I assume you mean with the same content?
One way is to make a copy of the main database (possibly refresh it now and then) for a second install online, with same plugins, settings etc.
Another way (bit riskier, but would give realtime sameness) would be to have a demo install on the same server that shares the same database: https://codex.wordpress.org/Editing_wp-config.php#table_prefix. I'd suggest with a custom user and usermeta where NO ONE has update privileges to avoid updates to the main site https://codex.wordpress.org/Editing_wp-config.php#Custom_User_and_Usermeta_Tables

wordpress site page infected with malicuious code

I have an issue with my WordPress site.
My website is generating adult pages which is not present on our website/database or server. It is showing in google search result like this for example siteurl.com/en/aarp-dating (around 500 pages google crawled) we have checked all our database and found around 30 new tables are automatically created and while we delete it after sometime it restore automatically.
How can I find the malicious code on my server/pages or what kind of problem is this?
Thanks in advance !!
Download the full installation, then compare the files' checksums with a clean backup or a fresh installation of the same WP + Plugins + Theme versions.
Most important: find out how they infected your site and close that hole or you will be back at square one in a short time after you've uploaded a clean backup. Check the Access Logs, filter out known IP addresses of you and your users, and look at the rest, especially POST requests. Also make sure to check the FTP-logs and (if you have ssh access to your host) auth logs to make sure that your/your coworkers' machines/passwords haven't been compromised.
Also make sure you don't miss any extra individual files or plugins that shouldn't be there.
You cannot trust what you see in the backend at this point, so check the database directly for new users you don't know and users with privileges they shouldn't have. Comparing with a recent backup can help.
Since it's not clear how long your site has been infected, I wouldn't trust recent backups (or any, really) either. Set up a fresh install after you found and fixed the entry point, then manually (or with a script, but be careful not to transfer back doors) transfer content to the clean install.
Use Wordfence Security Plugin & scan for infected core files of wordpress.
Use Sucuri plugin.
Also, desactivate ALL of your plugin and install a basic theme of wordpress before.

wordpress mobile theme infected

I was informed by google that my wordpress website has been hacked. i installed wordfence and i scanned al my files, I deleted all the infected plugins and restored all my original files. I scanned again, all is clean, i sent the reports (many scanners) to google, they verified and remove the "this site may be hacked" message.
I tried now to open my website to check the responsive mobile design on my samsung note 5, before the theme appearing about 300 little hyperlink such arx arm bmp amzd , every hyper link takes me to a scam website. My website is injected for sure how can i clean it from those hyperlinks ?
First of all make sure that your database is clean from all those infected links, it surely happened due to some vulnerable plugin or a theme, before you perform any action, backup your entire site, ground it, scan it using some reasonable wordpress virus detectors. Once you're done with it, start scanning your database for any unusual pages and links that you might have seen on your website. After performing this cleanup process. Install a fresh copy of wordpress by downloading it from the official website and install latest version of each and every plugin, also make sure to google about those plugins whether they are safer to use or not. import your wp_posts table at last and try to avoid importing unnecessary or easy to post / add stuffs.
Backup the database via PHPMyAdmin and completely uninstall WP. Then reinstall it again and restore the database.
Also, update any passwords on your webserver and even do a fresh install of the webserver.
Finally, avoid installing plugin's that aren't from the official repo as these can cause infections to your site.

Resources