Store Wordpress "uploads" folder on another server - php

I have four servers and and on one of these servers i have installed Wordpress for selling digital files. For security reasons i don't want to keep files on the same server as Wordpress is installed. I want to move "Uploads" folder to other three servers and connect theme to Wordpress core. So whenever i upload something via Wordpress i want it to be transferred to the second or third server based on file format. How is such thing possible?
P.S: Unfortunately i can't use Amazon S3.

This was an interesting answer:
https://wordpress.stackexchange.com/questions/74180/upload-images-to-remote-server/78129#78129
It is a bit outdated, but the code says is still does the trick. However, to do exactly what you need, some modifications are required.
Hopefully this will be helpful to you. Have a nice day!

Related

Copy whole WordPress instance onto my own Server? (Plugins, Blog entries etc.)

I'm currently trying to duplicate the WordPress instance my customer is running to do some testing before changing something in the live version. Sadly I can't figure out how to get all Data including the Woocommerce WebShop on my own Test-Server. My Test-Server is freshly installed and runs WordPress with MariaDB. All the Data I got from the customers Server is located in a Folder with the Name "www.WEBSITEOFCUSTOMER.at", I can't go higher into the Folder Hirarchy due to restrictions of his WebSpace Provider.
This is the Content of the "www.WEBSITEOFCUSTOMER.at" Folder
At some point it looked like I could just copy it over into my /var/www/html/wordpress/ but that destroyed my Test-Instance.
Assuming that I understand that you don't have deep and well knowledge about migration/transfers, I will suggest you to use the Duplicator Plugin to make your job without any issues. This plugin can packaging all your data in one file and then moving to another server/folder etc. you can extract the package with new address. But one notice here: You have to read how Duplicator works, then understand the process and then start to transfer. One good point to understand how the plugin works is to search on youtube where are many guides and examples to see. If you do one time you will not forget for ever. Like a bike in example ;)
Hope this help and if you meet any trouble during the process do not hesitate to ask again for further information.

How to restore a Drupal site from a file archive on another server?

My company recently inherited a client with a handful of sites using Drupal, and being primarily a WordPress shop, we don't really know where to start.
We were given a file archive of the web root to put on a fresh server. I'm guessing that this is a multi-site Drupal install, because there are three folders inside my /sites/ directory: all, default, and a folder describing my client.
I added new databases for the sql dumps inside sites/default/data and sites/[client]/data and referenced them in the two settings.php files where my databases are being called.
I also changed the $sites variable in sites/sites.php to reflect my new server address.
However, when I go to [server-address]/user/login and enter my username and password, all I can get to is the Drupal 7 Starter Site. Obviously, this isn't the information that I need, and I need to access my client's site.
Any help on this would be greatly appreciated.
This question seems like a variation of the question Drupal to Drupal Migration : did you correctly restore the .htaccess file(s) also? Those are "hidden" ( filename starts with a '.'), not shown by default by some FTP transfer softwares.
If that doesn't help, maybe these questions might help:
Migrating Drupal Site on SAME server; :
https://stackoverflow.com/questions/27925677/migrating-live-drupal-site-to-localhost :

How can I upload my joomla from scratch while keeping everything in place

my Joomla site has been infected with some virus, I managed to take it out but I'm afraid of that the attacker might have left a backdoor inside my server. I'm willing to take everything out of my site and re-install everything. Is there a way I could do it quickly? How can I save the db and configs?
thanks a lot
Joomla Docs has a fairly decent step by step checklist for recovering from hacks: http://docs.joomla.org/Security_Checklist/You_have_been_hacked_or_defaced
To backup the database, go into phpMyAdmin, select the database your Joomla site is running on, then there will be a button to "Export". click that, highlight all the tables and download it.
AS for the config file, you can get that from the root of the Joomla site in the FTP. The file is called configuration.php
What you could do, it take a full site backup, using the backup manager in your control panel, if there is one, or zip everything in the FTP and download it. Once done, extract the zip into a newly created folder and scan with an up to date, decent anti virus. If you don't have one, download a trial version of AVG Internet security 2013.

Multi-site File Manager in PHP: Update a single file in multipe sites w/one click?

I have a hosting (hostgator) account with a master directory and multiple subdirectories, each representing a www address. I'd like to know if its possible to create an interface in php that would allow me to update a given file (say, header.php) in a specific folder (my custom wordpress theme which resides in each site) which will be the same in every site.
I currently have to do this via FTP, but its cumbersome b/c I have to open each directory and copy the file to it. So if I have 30 sites to update, its very time consuming. i'd like to just have a list of sites with a checkbox beside each of them (and a "select all" toggle) and run the update on all sites in one click)
Thanks for your input!
PS: I know there are probably chron scripts or interfaces that can do this, but I'll be creating a scriptable (PHP) solution I can package up and send to someone and it just works and is brain-dead simple to use.
Yes, it's possible, you can modify files using PHP's file functions and you can communicate what to update through sockets.
It would be fairly complicated to implement though so I'm not sure what you're asking for.. Yes it's possible but I doubt someone here will give you a copy&paste solution. Do you have a more specific question?
EDIT: an easier solution would be to have a SVN repository so you can simply do it with one line of PHP code:
`svn update`
Any reason you're not using WordPress MU? With it and the child theme functionality built into recent versions of WordPress, your life might be a lot easier.
Yes:
I currently have to do this via FTP,
but its cumbersome b/c I have to open
each directory and copy the file to
it. So if I have 30 sites to update,
its very time consuming. i'd like to
just have a list of sites with a
checkbox beside each of them (and a
"select all" toggle) and run the
update on all sites in one click)
Basically you need to script those FTP actions and provide some logic as to what path and what files. You can then style the entire thing with a simple front end, listing your sites with a checkbox to select.
Doesn't seem difficult, just have to get the FTP path traversal working and file cp'ing down.
Have a look at Phing and search Google for deployment with PHP
If you are hosting multiple WP sites, you really should use WPMU.
I've implemented Uploadify for single / multiple file upload. Works great.
I also use Wordpress.
if its just the header.php and you dont have svn (you could setup an hook which would copy it for you to the right place)
you could write a bash script if you have ssh access

How can I safely port my wordpress blog to localhost?

I'm trying to make local development copies for my wordpress blog. I tried first to install wordpress locally (on XAMPP for Windows), install the plugins then import the live data (from a DB backup). The problem is whenever I import the live data I start getting all sorts of errors, even after I change the blog's URL through the database.
Also, the redirection rules I have on my server don't seem to work locally (whether set by wordpress or some of its plugins).
So is there a safe way to just grab the whole thing and make it work locally exactly like the server?
Your help is much appreciated :)
get a full backup of all the files in your online wordpress installation
get a complete backup of the database in use
with any text editing software, process the SQL file of the database backup and change every occurrence of http://old.site with http://localhost
extract the files to your document root
edit wp-config.php to tweak database host/user/pass
import the modified SQL backup
login into admin panel, go to Options->Permalink and save to update permalinks
No need to install anything, just grab what you have online. On windows you might have to rename .htaccess
Maybe somebody will come up with a tool, tutorial or a full HOWTO on this, but in the meantime a few general things on migration:
The redirection rules probably don't work because Windows has trouble with the .htaccess file name due to the starting .. What I usually do is, add (or change) the AccessFileName directive in my Apache config to htaccess.txt that makes the file better usable on Windows. If that doesn't help, put the contents of .htaccess up here.
From my (albeit limited) Experience with Wordpress, it is better to make a raw copy of the Wordpress file and data structure, rather than installing a fresh version and adding all the plugins. There is so much change in the Wordpress code base (automatic update of plugins etc.) that problems are legion. You would then have to change the paths locally in the configuration files, or set up a local path structure that exactly imitates that on the server.
Can you post some of the errors you get when using the live data?
Perhaps a much simpler way would just be to add a host reference from the address of blog to local host e.g. http://en.wikipedia.org/wiki/Hosts_file. This would allow you to test your blog as if it were actually running on the domain without any of the potential pitfalls.
Here is my 2cents tip:
If you are using plugins, and one of them has an api-key (for an example, Google's analytical toolkit, requires a key), the key may be bound to the IP address where your wordpress blog is located and may fail under the localhost (127.0.0.1). So double check to see if you can obtain a global key which can work on any IP address. This is dependent on the service and plugin. Google Maps is one, Recaptcha is another that comes to mind.
Hope this helps,
Best regards,
Tom.
kemp's answer is just about perfect. I only wanted to add that you could download something like VirtualBox or VMware and install Linux to it and get a webserver up and running on the virtual machine. This would let you get past any WAMP-LAMP inconsistencies.
Kemp's answer is good - but you don't need to edit your SQL dump, or change the database.
Instead, add 2 lines to your wp-config.php file (I normally add them just above the comment line in the file:
define('WP_HOME','http://localhost');
define('WP_SITEURL','http://localhost');
/* That's all, stop editing! Happy blogging. */ <-- this line already present in the file.

Categories