├── LICENSE ├── README.md ├── backup ├── converted │ └── index.html ├── index.html └── old │ └── index.html ├── docs ├── index.html ├── style.css └── wpmove.png ├── lang └── wpmove.pot ├── libs ├── functions-database-backup.php ├── functions-file-backup.php └── js │ ├── jquery.jstree.js │ └── themes │ └── default │ ├── d.png │ ├── file.png │ ├── style.css │ └── throbber.gif ├── readme.txt ├── uninstall.php └── wordpress-move.php /LICENSE: -------------------------------------------------------------------------------- 1 | GNU GENERAL PUBLIC LICENSE 2 | Version 2, June 1991 3 | 4 | Copyright (C) 1989, 1991 Free Software Foundation, Inc., 5 | 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 6 | Everyone is permitted to copy and distribute verbatim copies 7 | of this license document, but changing it is not allowed. 8 | 9 | Preamble 10 | 11 | The licenses for most software are designed to take away your 12 | freedom to share and change it. By contrast, the GNU General Public 13 | License is intended to guarantee your freedom to share and change free 14 | software--to make sure the software is free for all its users. This 15 | General Public License applies to most of the Free Software 16 | Foundation's software and to any other program whose authors commit to 17 | using it. (Some other Free Software Foundation software is covered by 18 | the GNU Lesser General Public License instead.) You can apply it to 19 | your programs, too. 20 | 21 | When we speak of free software, we are referring to freedom, not 22 | price. Our General Public Licenses are designed to make sure that you 23 | have the freedom to distribute copies of free software (and charge for 24 | this service if you wish), that you receive source code or can get it 25 | if you want it, that you can change the software or use pieces of it 26 | in new free programs; and that you know you can do these things. 27 | 28 | To protect your rights, we need to make restrictions that forbid 29 | anyone to deny you these rights or to ask you to surrender the rights. 30 | These restrictions translate to certain responsibilities for you if you 31 | distribute copies of the software, or if you modify it. 32 | 33 | For example, if you distribute copies of such a program, whether 34 | gratis or for a fee, you must give the recipients all the rights that 35 | you have. You must make sure that they, too, receive or can get the 36 | source code. And you must show them these terms so they know their 37 | rights. 38 | 39 | We protect your rights with two steps: (1) copyright the software, and 40 | (2) offer you this license which gives you legal permission to copy, 41 | distribute and/or modify the software. 42 | 43 | Also, for each author's protection and ours, we want to make certain 44 | that everyone understands that there is no warranty for this free 45 | software. If the software is modified by someone else and passed on, we 46 | want its recipients to know that what they have is not the original, so 47 | that any problems introduced by others will not reflect on the original 48 | authors' reputations. 49 | 50 | Finally, any free program is threatened constantly by software 51 | patents. We wish to avoid the danger that redistributors of a free 52 | program will individually obtain patent licenses, in effect making the 53 | program proprietary. To prevent this, we have made it clear that any 54 | patent must be licensed for everyone's free use or not licensed at all. 55 | 56 | The precise terms and conditions for copying, distribution and 57 | modification follow. 58 | 59 | GNU GENERAL PUBLIC LICENSE 60 | TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 61 | 62 | 0. This License applies to any program or other work which contains 63 | a notice placed by the copyright holder saying it may be distributed 64 | under the terms of this General Public License. The "Program", below, 65 | refers to any such program or work, and a "work based on the Program" 66 | means either the Program or any derivative work under copyright law: 67 | that is to say, a work containing the Program or a portion of it, 68 | either verbatim or with modifications and/or translated into another 69 | language. (Hereinafter, translation is included without limitation in 70 | the term "modification".) Each licensee is addressed as "you". 71 | 72 | Activities other than copying, distribution and modification are not 73 | covered by this License; they are outside its scope. The act of 74 | running the Program is not restricted, and the output from the Program 75 | is covered only if its contents constitute a work based on the 76 | Program (independent of having been made by running the Program). 77 | Whether that is true depends on what the Program does. 78 | 79 | 1. You may copy and distribute verbatim copies of the Program's 80 | source code as you receive it, in any medium, provided that you 81 | conspicuously and appropriately publish on each copy an appropriate 82 | copyright notice and disclaimer of warranty; keep intact all the 83 | notices that refer to this License and to the absence of any warranty; 84 | and give any other recipients of the Program a copy of this License 85 | along with the Program. 86 | 87 | You may charge a fee for the physical act of transferring a copy, and 88 | you may at your option offer warranty protection in exchange for a fee. 89 | 90 | 2. You may modify your copy or copies of the Program or any portion 91 | of it, thus forming a work based on the Program, and copy and 92 | distribute such modifications or work under the terms of Section 1 93 | above, provided that you also meet all of these conditions: 94 | 95 | a) You must cause the modified files to carry prominent notices 96 | stating that you changed the files and the date of any change. 97 | 98 | b) You must cause any work that you distribute or publish, that in 99 | whole or in part contains or is derived from the Program or any 100 | part thereof, to be licensed as a whole at no charge to all third 101 | parties under the terms of this License. 102 | 103 | c) If the modified program normally reads commands interactively 104 | when run, you must cause it, when started running for such 105 | interactive use in the most ordinary way, to print or display an 106 | announcement including an appropriate copyright notice and a 107 | notice that there is no warranty (or else, saying that you provide 108 | a warranty) and that users may redistribute the program under 109 | these conditions, and telling the user how to view a copy of this 110 | License. (Exception: if the Program itself is interactive but 111 | does not normally print such an announcement, your work based on 112 | the Program is not required to print an announcement.) 113 | 114 | These requirements apply to the modified work as a whole. If 115 | identifiable sections of that work are not derived from the Program, 116 | and can be reasonably considered independent and separate works in 117 | themselves, then this License, and its terms, do not apply to those 118 | sections when you distribute them as separate works. But when you 119 | distribute the same sections as part of a whole which is a work based 120 | on the Program, the distribution of the whole must be on the terms of 121 | this License, whose permissions for other licensees extend to the 122 | entire whole, and thus to each and every part regardless of who wrote it. 123 | 124 | Thus, it is not the intent of this section to claim rights or contest 125 | your rights to work written entirely by you; rather, the intent is to 126 | exercise the right to control the distribution of derivative or 127 | collective works based on the Program. 128 | 129 | In addition, mere aggregation of another work not based on the Program 130 | with the Program (or with a work based on the Program) on a volume of 131 | a storage or distribution medium does not bring the other work under 132 | the scope of this License. 133 | 134 | 3. You may copy and distribute the Program (or a work based on it, 135 | under Section 2) in object code or executable form under the terms of 136 | Sections 1 and 2 above provided that you also do one of the following: 137 | 138 | a) Accompany it with the complete corresponding machine-readable 139 | source code, which must be distributed under the terms of Sections 140 | 1 and 2 above on a medium customarily used for software interchange; or, 141 | 142 | b) Accompany it with a written offer, valid for at least three 143 | years, to give any third party, for a charge no more than your 144 | cost of physically performing source distribution, a complete 145 | machine-readable copy of the corresponding source code, to be 146 | distributed under the terms of Sections 1 and 2 above on a medium 147 | customarily used for software interchange; or, 148 | 149 | c) Accompany it with the information you received as to the offer 150 | to distribute corresponding source code. (This alternative is 151 | allowed only for noncommercial distribution and only if you 152 | received the program in object code or executable form with such 153 | an offer, in accord with Subsection b above.) 154 | 155 | The source code for a work means the preferred form of the work for 156 | making modifications to it. For an executable work, complete source 157 | code means all the source code for all modules it contains, plus any 158 | associated interface definition files, plus the scripts used to 159 | control compilation and installation of the executable. However, as a 160 | special exception, the source code distributed need not include 161 | anything that is normally distributed (in either source or binary 162 | form) with the major components (compiler, kernel, and so on) of the 163 | operating system on which the executable runs, unless that component 164 | itself accompanies the executable. 165 | 166 | If distribution of executable or object code is made by offering 167 | access to copy from a designated place, then offering equivalent 168 | access to copy the source code from the same place counts as 169 | distribution of the source code, even though third parties are not 170 | compelled to copy the source along with the object code. 171 | 172 | 4. You may not copy, modify, sublicense, or distribute the Program 173 | except as expressly provided under this License. Any attempt 174 | otherwise to copy, modify, sublicense or distribute the Program is 175 | void, and will automatically terminate your rights under this License. 176 | However, parties who have received copies, or rights, from you under 177 | this License will not have their licenses terminated so long as such 178 | parties remain in full compliance. 179 | 180 | 5. You are not required to accept this License, since you have not 181 | signed it. However, nothing else grants you permission to modify or 182 | distribute the Program or its derivative works. These actions are 183 | prohibited by law if you do not accept this License. Therefore, by 184 | modifying or distributing the Program (or any work based on the 185 | Program), you indicate your acceptance of this License to do so, and 186 | all its terms and conditions for copying, distributing or modifying 187 | the Program or works based on it. 188 | 189 | 6. Each time you redistribute the Program (or any work based on the 190 | Program), the recipient automatically receives a license from the 191 | original licensor to copy, distribute or modify the Program subject to 192 | these terms and conditions. You may not impose any further 193 | restrictions on the recipients' exercise of the rights granted herein. 194 | You are not responsible for enforcing compliance by third parties to 195 | this License. 196 | 197 | 7. If, as a consequence of a court judgment or allegation of patent 198 | infringement or for any other reason (not limited to patent issues), 199 | conditions are imposed on you (whether by court order, agreement or 200 | otherwise) that contradict the conditions of this License, they do not 201 | excuse you from the conditions of this License. If you cannot 202 | distribute so as to satisfy simultaneously your obligations under this 203 | License and any other pertinent obligations, then as a consequence you 204 | may not distribute the Program at all. For example, if a patent 205 | license would not permit royalty-free redistribution of the Program by 206 | all those who receive copies directly or indirectly through you, then 207 | the only way you could satisfy both it and this License would be to 208 | refrain entirely from distribution of the Program. 209 | 210 | If any portion of this section is held invalid or unenforceable under 211 | any particular circumstance, the balance of the section is intended to 212 | apply and the section as a whole is intended to apply in other 213 | circumstances. 214 | 215 | It is not the purpose of this section to induce you to infringe any 216 | patents or other property right claims or to contest validity of any 217 | such claims; this section has the sole purpose of protecting the 218 | integrity of the free software distribution system, which is 219 | implemented by public license practices. Many people have made 220 | generous contributions to the wide range of software distributed 221 | through that system in reliance on consistent application of that 222 | system; it is up to the author/donor to decide if he or she is willing 223 | to distribute software through any other system and a licensee cannot 224 | impose that choice. 225 | 226 | This section is intended to make thoroughly clear what is believed to 227 | be a consequence of the rest of this License. 228 | 229 | 8. If the distribution and/or use of the Program is restricted in 230 | certain countries either by patents or by copyrighted interfaces, the 231 | original copyright holder who places the Program under this License 232 | may add an explicit geographical distribution limitation excluding 233 | those countries, so that distribution is permitted only in or among 234 | countries not thus excluded. In such case, this License incorporates 235 | the limitation as if written in the body of this License. 236 | 237 | 9. The Free Software Foundation may publish revised and/or new versions 238 | of the General Public License from time to time. Such new versions will 239 | be similar in spirit to the present version, but may differ in detail to 240 | address new problems or concerns. 241 | 242 | Each version is given a distinguishing version number. If the Program 243 | specifies a version number of this License which applies to it and "any 244 | later version", you have the option of following the terms and conditions 245 | either of that version or of any later version published by the Free 246 | Software Foundation. If the Program does not specify a version number of 247 | this License, you may choose any version ever published by the Free Software 248 | Foundation. 249 | 250 | 10. If you wish to incorporate parts of the Program into other free 251 | programs whose distribution conditions are different, write to the author 252 | to ask for permission. For software which is copyrighted by the Free 253 | Software Foundation, write to the Free Software Foundation; we sometimes 254 | make exceptions for this. Our decision will be guided by the two goals 255 | of preserving the free status of all derivatives of our free software and 256 | of promoting the sharing and reuse of software generally. 257 | 258 | NO WARRANTY 259 | 260 | 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY 261 | FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN 262 | OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES 263 | PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED 264 | OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 265 | MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS 266 | TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE 267 | PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, 268 | REPAIR OR CORRECTION. 269 | 270 | 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING 271 | WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR 272 | REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, 273 | INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING 274 | OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED 275 | TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY 276 | YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER 277 | PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE 278 | POSSIBILITY OF SUCH DAMAGES. 279 | 280 | END OF TERMS AND CONDITIONS 281 | 282 | How to Apply These Terms to Your New Programs 283 | 284 | If you develop a new program, and you want it to be of the greatest 285 | possible use to the public, the best way to achieve this is to make it 286 | free software which everyone can redistribute and change under these terms. 287 | 288 | To do so, attach the following notices to the program. It is safest 289 | to attach them to the start of each source file to most effectively 290 | convey the exclusion of warranty; and each file should have at least 291 | the "copyright" line and a pointer to where the full notice is found. 292 | 293 | {{description}} 294 | Copyright (C) {{year}} {{fullname}} 295 | 296 | This program is free software; you can redistribute it and/or modify 297 | it under the terms of the GNU General Public License as published by 298 | the Free Software Foundation; either version 2 of the License, or 299 | (at your option) any later version. 300 | 301 | This program is distributed in the hope that it will be useful, 302 | but WITHOUT ANY WARRANTY; without even the implied warranty of 303 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 304 | GNU General Public License for more details. 305 | 306 | You should have received a copy of the GNU General Public License along 307 | with this program; if not, write to the Free Software Foundation, Inc., 308 | 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 309 | 310 | Also add information on how to contact you by electronic and paper mail. 311 | 312 | If the program is interactive, make it output a short notice like this 313 | when it starts in an interactive mode: 314 | 315 | Gnomovision version 69, Copyright (C) year name of author 316 | Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. 317 | This is free software, and you are welcome to redistribute it 318 | under certain conditions; type `show c' for details. 319 | 320 | The hypothetical commands `show w' and `show c' should show the appropriate 321 | parts of the General Public License. Of course, the commands you use may 322 | be called something other than `show w' and `show c'; they could even be 323 | mouse-clicks or menu items--whatever suits your program. 324 | 325 | You should also get your employer (if you work as a programmer) or your 326 | school, if any, to sign a "copyright disclaimer" for the program, if 327 | necessary. Here is a sample; alter the names: 328 | 329 | Yoyodyne, Inc., hereby disclaims all copyright interest in the program 330 | `Gnomovision' (which makes passes at compilers) written by James Hacker. 331 | 332 | {signature of Ty Coon}, 1 April 1989 333 | Ty Coon, President of Vice 334 | 335 | This General Public License does not permit incorporating your program into 336 | proprietary programs. If your program is a subroutine library, you may 337 | consider it more useful to permit linking proprietary applications with the 338 | library. If this is what you want to do, use the GNU Lesser General 339 | Public License instead of this License. 340 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | WordPress Move 2 | ========== 3 | 4 | WordPress Move enables you to back up your installation to restore to at any time, change the domain name in use and migrate your installation to another server. 5 | 6 | Description 7 | --------- 8 | 9 | WordPress Move is a migration assistant for WordPress that is capable of changing the domain name in use and/or migrating your installation to another server either as is or based on your choices. In addition to these, you can use WordPress Move to transfer your database or create backups of your installation. For further information on using the plugin, please refer to the documentation provided with the plugin. 10 | 11 | **Disclaimer:** Even though this plugin is heavily tested, please use it at your own risk and do not forget to back up your files beforehand. 12 | 13 | Installation 14 | --------- 15 | 16 | **1.** Upload `wordpress-move` to the `/wp-content/plugins/` directory 17 | 18 | **2.** Activate the plugin through the 'Plugins' menu in WordPress 19 | 20 | **3.** Configure the plugin through the WordPress Move page under the 'Settings' menu 21 | 22 | **4.** Start using the tools added under the 'Tools' menu 23 | 24 | 25 | Frequently Asked Questions 26 | ---------------------- 27 | 28 | **I am getting the "Could not activate the plugin because it generated a fatal error." error when I try to activate the plugin. Why?** 29 | 30 | WordPress Move needs php_sockets extension to be enabled, in order to work properly. If you are getting this error message, please enable php_sockets extension and restart your web server. Once you successfully enable the extension, you will be able to activate the plugin. 31 | 32 | **Do I need to install WordPress and WordPress Move on the new server as well, if I want to use WordPress Move for migration purposes?** 33 | 34 | Yes you do. 35 | 36 | **Is it possible to both migrate to another server and change the domain name?** 37 | 38 | Yes. You can choose whether you want to change your domain name or not on the migration screen. Note that it does not change the domain name used by the current installation, it just replaces instances of the old domain name with the new one on the fly while creating a database backup for migration. 39 | 40 | **Can I use WordPress Move to create backups of my installation?** 41 | 42 | Yes, you can. Click either "Create a Database Backup" button or "Create a Full Backup" button to create a backup. Your backup files will be stored under the backup directory. You can use Complete Migration mode whenever you want to use those files to revert to a former state of your installation. 43 | 44 | **Can I use WordPress Move to transfer my database backup only?** 45 | 46 | Yes, you can. All you need to do is selecting the Advanced Migration during the migration type selection page and not selecting any files when the file tree is displayed. Once you click the Start Migration button, the plugin will create a backup of your database only and transfer it to your new server. When you run WordPress Move on your new server in Complete Migration mode, the plugin will import the database backup created by your old WordPress installation. 47 | 48 | **Does WordPress Move take care of changing the whole domain name changing process?** 49 | 50 | No, it does not. WordPress Move just replaces instances of your old domain name in your database with the new domain name you provide. It is still your responsibility to point your domain name to the name servers used by your hosting company and make necessary configurations on the control panel provided by your hosting company. Before starting this process, please request assistance from your hosting company as some companies' systems erase all your data without creating backups when you change your domain name. Also, do not forget that it is always a good idea to have a backup of your files and the database before starting operations like these. 51 | 52 | **Plugin fails to create backup files because it says my backup directory is not writable. How can I fix this?** 53 | 54 | As the warning suggests, you need to make the backup directory writable by the plugin. Permission settings vary from server to server so there is no specific value to set the directory permissions to. The easiest way to fix this problem yourself is using an FTP client to alter permission settings of the backup directory until plugin successfully creates backup files. You may also prefer requesting assistance from your hosting company. 55 | 56 | **I am a pre-1.2 user, what will happen to the FTP Password that is already stored in my database?** 57 | 58 | Visiting the WordPress Move Settings page any time after updating the plugin will remove it from the database permanently. 59 | 60 | **Can I use the database backup files that WordPress Move generates with phpMyAdmin?** 61 | 62 | You can convert a database backup file using the Convert option in the Backup Manager to use it outside the plugin. So, yes, you can use the *converted* database backup files with phpMyAdmin or any other script. 63 | 64 | Changelog 65 | -------- 66 | 67 | **1.3.2** 68 | 69 | * Fixed the bug causing problems with other plugins such as Gravity Forms. 70 | 71 | **1.3.1** 72 | 73 | * Fixed several bugs. 74 | 75 | * Improved the performance of the plugin in complex tasks. 76 | 77 | * It is now possible to download a backup file by clicking on its name. 78 | 79 | * If the Safe Mode is disabled, operations will not be interrupted by the maximum execution time error anymore. 80 | 81 | **1.3** 82 | 83 | * Explanation for Change Domain Name is rephrased. 84 | 85 | * Simple and Advanced Migration methods are merged. 86 | 87 | * Meta boxes are added to the migration page. 88 | 89 | * A database backup converter is integrated to convert WordPress-Move-only database backup files to generic SQL files. 90 | 91 | * Backup files to use for restoration can now be selected right on the Restore page. 92 | 93 | * Messages are now displayed in real-time on migration and restoration pages. 94 | 95 | * Empty HTML files are added to backup directories to prevent them being listed by people trying to access the directory via their browsers. 96 | 97 | 98 | **1.2** 99 | 100 | * FTP Passwords are no longer stored in the database, for security reasons. Visit the WordPress Move Settings page after updating the plugin to remove it from the database permanently. 101 | 102 | * It is now possible to create either a full backup or a database backup, using Backup Manager. 103 | 104 | * Fixed another PHP Catchable Fatal Error some people encounter. 105 | 106 | * Plugin is now really able to check whether importing the database backup was successful or not. 107 | 108 | * Explanations on the Migration Assistant page are replaced with more clear ones. 109 | 110 | * Added meta boxes to the Migration Assistant. 111 | 112 | 113 | **1.1.1** 114 | 115 | * Transients are no longer included in database backups to reduce the database backup files' sizes. 116 | 117 | * Backup files created before changing the domain name are now being stored under the old backup directory for a possible future need. 118 | 119 | * Fixed the PHP Catchable Fatal Error some people encounter. 120 | 121 | * Added meta boxes to the settings page. 122 | 123 | 124 | **1.1** 125 | 126 | * Added "Backup Now" functionality to Backup Manager. 127 | 128 | * Added the capability of migrating and changing the domain name at the same time. 129 | 130 | 131 | **1.0** 132 | 133 | * Initial release. 134 | 135 | Upgrade Notice 136 | ------------ 137 | 138 | **1.3.2** 139 | 140 | The bug that was causing problems with other plugins has been fixed. Previous releases were omitting NULL fields and causing data loss as a result. 141 | 142 | **1.3.1** 143 | 144 | Performance has been improved and several bugs have been fixed. Also, if the Safe Mode is disabled, operations will not be interrupted by the maximum execution time error anymore. 145 | 146 | **1.3** 147 | 148 | Simple and Advanced Migration methods are merged and a database backup converter is integrated into the Backup Manager. 149 | 150 | **1.2** 151 | 152 | FTP Passwords are no longer stored in the database, for security reasons. It is now possible to create either a full backup or a database backup, using Backup Manager. Explanations on the Migration Assistant page are replaced with more clear ones. 153 | 154 | **1.1.1** 155 | 156 | Database backup files will be smaller now as transients will not be included in database backup files. Backup files created before changing the domain name are now being stored under the old backup directory for a possible future need. A small bug is fixed and meta boxes are added to the settings page of the plugin. 157 | 158 | **1.1** 159 | 160 | You can now create a full backup of your installation using the Backup Now button on the Backup Manager page. Also, migrating and changing the domain name at the same time is now supported. 161 | 162 | **1.0** 163 | 164 | Initial release. 165 | -------------------------------------------------------------------------------- /backup/converted/index.html: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/merty/wordpress-move/ae8638ce1340cd1b7a20cf297dcfdcff2b9d11bb/backup/converted/index.html -------------------------------------------------------------------------------- /backup/index.html: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/merty/wordpress-move/ae8638ce1340cd1b7a20cf297dcfdcff2b9d11bb/backup/index.html -------------------------------------------------------------------------------- /backup/old/index.html: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/merty/wordpress-move/ae8638ce1340cd1b7a20cf297dcfdcff2b9d11bb/backup/old/index.html -------------------------------------------------------------------------------- /docs/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | WordPress Move Documentation 4 | 5 | 6 | 7 |

8 |

This documentation is was written to help new WordPress Move users start using the plugin faster and more efficiently. Even though the plugin is designed to be as straightforward as possible, it may still be confusing for new users. It is highly recommended that you read this documentation before using the plugin. You can find the list of topics covered in this documentation below.

9 |

Contents

10 | 27 |

Installation

28 |

Installing WordPress Move is no different than other plugins. You can either download the plugin from WordPress Plugin Directory and install it manually or use the search feature on the Install Plugin page.

29 |

There are actually two different types of manual installations. For both of them, first you need to download the plugin in .zip format from WordPress Plugin Directory. Then you can follow one of the manual installation methods explained below.

30 |

The first way is using the Upload tab on the Install Plugin page. To begin, please navigate to Administration Panel → Plugins → Add New → Upload to upload the .zip file you have just downloaded. Once you select the file to upload from your computer and click the Install Now button, WordPress will automatically install the plugin for you.

31 |

The second way is uploading the contents of the .zip file you have just downloaded to /wp-content/plugins/ directory using your FTP client. Do not forget that you need to upload the directory inside the .zip file not the .zip file itself. For further instructions on uploading files using your FTP client, please refer to the documentation of your FTP client.

32 |

The easiest way to install the plugin, however, is using the Search feature on the Install Plugin page. To begin, please navigate to Administration Panel → Plugins → Add New where you can search for the plugin by typing WordPress Move to the textbox and clicking the Search Plugins button. Then, on the search results page, please click the Install Now link displayed under the name of the plugin to begin installing the plugin.

33 |

After following one of these three methods, please navigate to Administration Panel → Plugins → Installed Plugins page and activate the plugin using the Activate link display right under the name of the plugin. Once you see the Plugin activated. notification at the top, you are ready to start using the plugin.

34 |

Configuration

35 |

Once you activated WordPress Move, it added 3 pages to your Administration Panel: Migration Assistant, Backup Manager and WordPress Move. First two are located under the Tools menu while the last one is located under the Settings menu. To configure the plugin, you need to navigate to WordPress Move page under the Settings menu. Before diving into configuring the plugin, please note that configuration is only necessary if you are planning to use the plugin to migrate to another server. In other words, you do not need any configuration if you are only going to use the plugin to change the domain name of your existing installation. or complete the migration started from another server. Also, if you are planning to use the plugin to migrate your existing installation to another server, first you need to install WordPress and WordPress Move on the remote server as well before continuing.

36 |

If you have successfully completed installing WordPress and WordPress Move on the remote server, please navigate to WordPress Move Settings page, where you will see eight settings under three titles.

37 | 42 |

Now you are ready to start the migration by going to the Migration Assistant page under the Tools menu.

43 |

Using The Plugin

44 |

Using the plugin is fairly simple. If you want to change your domain name, start migrating to another server or complete the migration you have already started from another server, you need to navigate to Migration Assistant page under the tools menu. However, if you want to manage the backup files under the backup directory, you need to navigate to Backup Manager page under the tools menu.

45 |

Migration Assistant

46 |

Migration Assistant welcomes you with three different actions you may want to perform: Change Domain Name, Start Migration and Restore. If you wish to only change the domain name of your current installation, you should click the Change Domain Name link. If you wish to migrate to another server, you should click the Start Migration link. Once again, do not forget that you need to configure the plugin by going to WordPress Move page under the Settings menu before starting the migration. And finally, if you wish to complete the migration process started from another server, click the Complete Migration link.

47 |

Change Domain Name

48 |

Changing the domain name that your current installation operates on is quite easy. Just type in the new domain name you want to use instead of the current domain name and click the Change button. Plugin will immediately change all instances of your old domain name in the database with your new domain name. WordPress Move also backups your database before starting the operation so if something goes wrong, it rolls back all the changes made. Of course, rolling back may also fail under some circumstances so creating a backup of your database manually beforehand is always a good idea. WordPress Move actually saves the backup file it creates beforehand to the old backup directory in case something goes wrong either during the domain name changing procedure or afterwards. Note that database backup files WordPress Move creates are not like normal database backup files, so you will need a working instance of WordPress Move on that server to be able to restore using those backup files. Still, creating a backup file yourself is highly encouraged. Do not forget that WordPress Move only replaces instances of your old domain name in the database with your new domain name and does not make any further configurations needed to make your domain work on your host. Please refer to the question in the FAQ section for some additional information about this.

49 |

Migrate

50 |

Migration page displays all the files under your WordPress installation directory and asks you which files to backup. Once you click the Start Migration button, it creates the backup of your database and the files (in chunks if you set a Chunk Size on the settings page of the plugin) you selected, and uploads them to the remote server. If you do not select any files, only a backup of your database will be uploaded to the server you want to migrate to. Also, the option to change the domain name that will be used on your new server is provided as well. It only changes the domain name that will be used by the installation in the receiving end. When starting the migration succeeds, you can run WordPress Move on the remote server in Complete Migration mode to complete the migration process.

51 |

Restore

52 |

Restore option basically imports database backups and extracts filesystem backups, created and uploaded by WordPress Move on the server you want to migrate from. When you navigate to Restore page, it lists all the backup files inside the main backup directory aka Current Backups that you can choose from to complete the migration. Do not forget that this process does not create a backup of your existing installation so if something goes wrong, it will not be possible to rollback the changes. It is your responsibility to backup your files and the database before clicking the Complete Migration button. If there are no files listed on the Complete Migration page, please make sure you started the migration successfully using WordPress Move on the server you are migrating from.

53 |

Backup Manager

54 |

Backup Manager is the place to organize the backup files either created by the plugin on the same server, or uploaded by the server you are migrating from. If this is the server you want to migrate from, you can delete backup files after the Migration Assistant completes uploading them to the remote server. If you do not want to delete them, you can Archive them which basically means moving them to a sub-directory called old. You can always Unarchive the files you Archived using the Backup Manager. Files listed under Current Backups are the files that will be used by the Complete Migration mode so you can either delete or achive the files you do not want Complete Migration to use. Files listed under the Old Backups section are not used for anything so you can safely Archive the backup files you do not want to use but also do not want to delete.

55 |

Since version 1.3, there is also Converted Database Backups section where which lists the database backup files that can be used outside the WordPress Move. As you might have noticed, database backups generated by WordPress Move have a different structure than normal database backup files which is the reason why you cannot use them outside the WordPress Move. To use database backup file outside the WordPress Move, simply find it in either Current Backups or Old Backups section, select the checkbox on the left, select the Convert option from the dropdown and click the Apply button. This will convert the files you have selected into generic SQL files that you can use outside the plugin. This feature is particularly useful if the plugin fails to migrate your installation properly or if you need to use the database backup file outside the plugin.

56 |

If you wish to download a backup file, you can click on its name. That way, if the plugin fails send your files to the server on the receiving end, you can easily download your backup files and upload them to the /wp-content/plugins/wordpress-move/backup/ directory on your new server. Once you finish uploading them, you can use the Restore method to finalize the migration operation.

57 |

Frequently Asked Questions

58 |
    59 |
  1. I am getting the "Could not activate the plugin because it generated a fatal error." error when I try to activate the plugin. Why? 60 |
    WordPress Move needs php_sockets extension to be enabled, in order to work properly. If you are getting this error message, please enable php_sockets extension and restart your web server. Once you successfully enable the extension, you will be able to activate the plugin.
  2. 61 |
  3. Do I need to install WordPress and WordPress Move on the new server as well, if I want to use WordPress Move for migration purposes? 62 |
    Yes you do.
  4. 63 |
  5. Is it possible to both migrate to another server and change the domain name? 64 |
    Yes. You can choose whether you want to change your domain name or not on the migration screen. Note that it does not change the domain name used by the current installation, it just replaces instances of the old domain name with the new one on the fly while creating a database backup for migration.
  6. 65 |
  7. Can I use WordPress Move to create backups of my installation? 66 |
    Yes, you can. Click either Create a Database Backup button or Create a Full Backup button to create a backup. Your backup files will be stored under the backup directory. You can use Complete Migration mode whenever you want to use those files to revert to a former state of your installation.
  8. 67 |
  9. Can I use WordPress Move to transfer my database backup only? 68 |
    Yes, you can. All you need to do is selecting the Advanced Migration during the migration type selection page and not selecting any files when the file tree is displayed. Once you click the Start Migration button, the plugin will create a backup of your database only and transfer it to your new server. When you run WordPress Move on your new server in Complete Migration mode, the plugin will import the database backup created by your old WordPress installation.
  10. 69 |
  11. Does WordPress Move take care of changing the whole domain name changing process? 70 |
    No, it does not. WordPress Move just replaces instances of your old domain name in your database with the new domain name you provide. It is still your responsibility to point your domain name to the name servers used by your hosting company and make necessary configurations on the control panel provided by your hosting company. Before starting this process, please request assistance from your hosting company as some companies' systems erase all your data without creating backups when you change your domain name. Also, do not forget that it is always a good idea to have a backup of your files and the database before starting operations like these.
  12. 71 |
  13. Plugin fails to create backup files because it says my backup directory is not writable. How can I fix this? 72 |
    As the warning suggests, you need to make the backup directory writable by the plugin. Permission settings vary from server to server so there is no specific value to set the directory permissions to. The easiest way to fix this problem yourself is using an FTP client to alter permission settings of the backup directory until plugin successfully creates backup files. You may also prefer requesting assistance from your hosting company.
  14. 73 |
  15. I am a pre-1.2 user, what will happen to the FTP Password that is already stored in my database? 74 |
    Visiting the WordPress Move Settings page any time after updating the plugin will remove it from the database permanently.
  16. 75 |
  17. Can I use the database backup files that WordPress Move generates with phpMyAdmin? 76 |
    You can convert a database backup file using the Convert option in the Backup Manager to use it outside the plugin. So, yes, you can use the converted database backup files with phpMyAdmin or any other script.
  18. 77 |
78 |

Project sponsored by Google, developed by Mert Yazicioglu and mentored by Pete Mall and Brian Layman.

79 | 80 | -------------------------------------------------------------------------------- /docs/style.css: -------------------------------------------------------------------------------- 1 | html { 2 | background-color: #f9f9f9; 3 | } 4 | 5 | body { 6 | background-color: #ffffff; 7 | border: 1px solid #dfdfdf; 8 | border-radius: 11px; 9 | font-family: sans-serif; 10 | margin: 2em auto; 11 | padding: 1em 2em; 12 | width: 700px; 13 | -khtml-border-radius: 11px; 14 | -moz-border-radius: 11px; 15 | -webkit-border-radius: 11px; 16 | } 17 | 18 | a { 19 | color: #21759b; 20 | } 21 | 22 | a:hover, a:active, a:focus { 23 | color: #d54e21; 24 | } 25 | 26 | code { 27 | background: #eaeaea; 28 | font: 11px Consolas, Monaco, monospace; 29 | margin: 0 1px; 30 | padding: 1px 3px; 31 | } 32 | 33 | h1, h2, h3 { 34 | border-bottom: 1px solid #dadada; 35 | clear: both; 36 | color: #666666; 37 | font: 24px Georgia, "Times New Roman", Times, serif; 38 | margin: 5px 0 0 -4px; 39 | padding: 0px; 40 | padding-bottom: 7px; 41 | } 42 | 43 | h3 { 44 | font-size: 20px; 45 | } 46 | 47 | p, li { 48 | font-size: 12px; 49 | line-height: 18px; 50 | padding-bottom: 2px; 51 | } 52 | 53 | .credits { 54 | text-align: center; 55 | } 56 | 57 | #logo { 58 | border-bottom: none; 59 | margin: 6px 0 14px 0; 60 | text-align: center; 61 | } -------------------------------------------------------------------------------- /docs/wpmove.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/merty/wordpress-move/ae8638ce1340cd1b7a20cf297dcfdcff2b9d11bb/docs/wpmove.png -------------------------------------------------------------------------------- /lang/wpmove.pot: -------------------------------------------------------------------------------- 1 | msgid "" 2 | msgstr "" 3 | "Project-Id-Version: WPMove\n" 4 | "Report-Msgid-Bugs-To: \n" 5 | "POT-Creation-Date: 2012-02-29 17:49+0200\n" 6 | "PO-Revision-Date: 2012-02-29 17:49+0200\n" 7 | "Last-Translator: Mert Yazicioglu \n" 8 | "Language-Team: \n" 9 | "MIME-Version: 1.0\n" 10 | "Content-Type: text/plain; charset=UTF-8\n" 11 | "Content-Transfer-Encoding: 8bit\n" 12 | "X-Poedit-KeywordsList: _;gettext;gettext_noop;__;_e;_n\n" 13 | "X-Poedit-Basepath: .\n" 14 | "X-Poedit-SearchPath-0: C:\\xampp\\htdocs\\wp\\wp-content\\plugins\\wordpress-move\n" 15 | 16 | #: C:\xampp\htdocs\wp\wp-content\plugins\wordpress-move/wordpress-move.php:135 17 | #: C:\xampp\htdocs\wp\wp-content\plugins\wordpress-move/wordpress-move.php:959 18 | msgid "Change Domain Name" 19 | msgstr "" 20 | 21 | #: C:\xampp\htdocs\wp\wp-content\plugins\wordpress-move/wordpress-move.php:136 22 | msgid "Migrate" 23 | msgstr "" 24 | 25 | #: C:\xampp\htdocs\wp\wp-content\plugins\wordpress-move/wordpress-move.php:137 26 | msgid "Restore" 27 | msgstr "" 28 | 29 | #: C:\xampp\htdocs\wp\wp-content\plugins\wordpress-move/wordpress-move.php:138 30 | msgid "FTP Settings" 31 | msgstr "" 32 | 33 | #: C:\xampp\htdocs\wp\wp-content\plugins\wordpress-move/wordpress-move.php:139 34 | msgid "Change Domain Name (Optional)" 35 | msgstr "" 36 | 37 | #: C:\xampp\htdocs\wp\wp-content\plugins\wordpress-move/wordpress-move.php:140 38 | msgid "Files to Transfer" 39 | msgstr "" 40 | 41 | #: C:\xampp\htdocs\wp\wp-content\plugins\wordpress-move/wordpress-move.php:174 42 | msgid "FTP Connection Details" 43 | msgstr "" 44 | 45 | #: C:\xampp\htdocs\wp\wp-content\plugins\wordpress-move/wordpress-move.php:175 46 | msgid "Database Backup Settings" 47 | msgstr "" 48 | 49 | #: C:\xampp\htdocs\wp\wp-content\plugins\wordpress-move/wordpress-move.php:176 50 | msgid "File Backup Settings" 51 | msgstr "" 52 | 53 | #: C:\xampp\htdocs\wp\wp-content\plugins\wordpress-move/wordpress-move.php:258 54 | msgid "Settings saved." 55 | msgstr "" 56 | 57 | #: C:\xampp\htdocs\wp\wp-content\plugins\wordpress-move/wordpress-move.php:264 58 | msgid "Please fill in FTP Connection Details in order to start the migration process." 59 | msgstr "" 60 | 61 | #: C:\xampp\htdocs\wp\wp-content\plugins\wordpress-move/wordpress-move.php:271 62 | msgid "WordPress Move Settings" 63 | msgstr "" 64 | 65 | #: C:\xampp\htdocs\wp\wp-content\plugins\wordpress-move/wordpress-move.php:273 66 | msgid "Please configure the plugin using the settings below before starting to use the Migration Assistant under the Tools menu. If connecting to the remote server fails, please toggle the Passive Mode setting and try again." 67 | msgstr "" 68 | 69 | #: C:\xampp\htdocs\wp\wp-content\plugins\wordpress-move/wordpress-move.php:314 70 | msgid "These are the FTP connection details of your new server." 71 | msgstr "" 72 | 73 | #: C:\xampp\htdocs\wp\wp-content\plugins\wordpress-move/wordpress-move.php:320 74 | msgid "Hostname" 75 | msgstr "" 76 | 77 | #: C:\xampp\htdocs\wp\wp-content\plugins\wordpress-move/wordpress-move.php:323 78 | msgid "The hostname you use to establish an FTP connection to the remote server. Might be an IP address or a domain name." 79 | msgstr "" 80 | 81 | #: C:\xampp\htdocs\wp\wp-content\plugins\wordpress-move/wordpress-move.php:328 82 | msgid "Port" 83 | msgstr "" 84 | 85 | #: C:\xampp\htdocs\wp\wp-content\plugins\wordpress-move/wordpress-move.php:331 86 | msgid "If you do not know what to write, it is most probably 21." 87 | msgstr "" 88 | 89 | #: C:\xampp\htdocs\wp\wp-content\plugins\wordpress-move/wordpress-move.php:336 90 | msgid "Username" 91 | msgstr "" 92 | 93 | #: C:\xampp\htdocs\wp\wp-content\plugins\wordpress-move/wordpress-move.php:339 94 | msgid "The username you use to establish an FTP connection to the remote server." 95 | msgstr "" 96 | 97 | #: C:\xampp\htdocs\wp\wp-content\plugins\wordpress-move/wordpress-move.php:344 98 | msgid "Password" 99 | msgstr "" 100 | 101 | #: C:\xampp\htdocs\wp\wp-content\plugins\wordpress-move/wordpress-move.php:347 102 | msgid "You will be asked to enter your FTP Password you use to establish an FTP connection to the remote server, right before starting the migration process." 103 | msgstr "" 104 | 105 | #: C:\xampp\htdocs\wp\wp-content\plugins\wordpress-move/wordpress-move.php:352 106 | msgid "Remote Backup Path" 107 | msgstr "" 108 | 109 | #: C:\xampp\htdocs\wp\wp-content\plugins\wordpress-move/wordpress-move.php:355 110 | msgid "Path from the top directory that your FTP account has access to, to the backup directory of the WordPress Move plugin on the remote server. For instance:" 111 | msgstr "" 112 | 113 | #: C:\xampp\htdocs\wp\wp-content\plugins\wordpress-move/wordpress-move.php:360 114 | msgid "Use Passive Mode" 115 | msgstr "" 116 | 117 | #: C:\xampp\htdocs\wp\wp-content\plugins\wordpress-move/wordpress-move.php:365 118 | msgid "Yes" 119 | msgstr "" 120 | 121 | #: C:\xampp\htdocs\wp\wp-content\plugins\wordpress-move/wordpress-move.php:370 122 | msgid "No" 123 | msgstr "" 124 | 125 | #: C:\xampp\htdocs\wp\wp-content\plugins\wordpress-move/wordpress-move.php:390 126 | msgid "The size of each chunk of your database backup. Actual sizes of chunks may exceed this size limit. 0 means unlimited." 127 | msgstr "" 128 | 129 | #: C:\xampp\htdocs\wp\wp-content\plugins\wordpress-move/wordpress-move.php:396 130 | #: C:\xampp\htdocs\wp\wp-content\plugins\wordpress-move/wordpress-move.php:424 131 | msgid "Chunk Size" 132 | msgstr "" 133 | 134 | #: C:\xampp\htdocs\wp\wp-content\plugins\wordpress-move/wordpress-move.php:418 135 | msgid "The size of files to compress per filesystem backup chunk. Sizes of chunks will be less than or equal to this size limit, depending on the compression ratio. 0 means unlimited." 136 | msgstr "" 137 | 138 | #: C:\xampp\htdocs\wp\wp-content\plugins\wordpress-move/wordpress-move.php:462 139 | #: C:\xampp\htdocs\wp\wp-content\plugins\wordpress-move/wordpress-move.php:787 140 | #: C:\xampp\htdocs\wp\wp-content\plugins\wordpress-move/wordpress-move.php:871 141 | #: C:\xampp\htdocs\wp\wp-content\plugins\wordpress-move/wordpress-move.php:1811 142 | msgid "Migration Assistant" 143 | msgstr "" 144 | 145 | #: C:\xampp\htdocs\wp\wp-content\plugins\wordpress-move/wordpress-move.php:464 146 | msgid "Please make sure you read the documentation carefully, before selecting an action to proceed..." 147 | msgstr "" 148 | 149 | #: C:\xampp\htdocs\wp\wp-content\plugins\wordpress-move/wordpress-move.php:507 150 | msgid "If you wish to do the following..." 151 | msgstr "" 152 | 153 | #: C:\xampp\htdocs\wp\wp-content\plugins\wordpress-move/wordpress-move.php:510 154 | msgid "Just change the domain name this installation uses." 155 | msgstr "" 156 | 157 | #: C:\xampp\htdocs\wp\wp-content\plugins\wordpress-move/wordpress-move.php:513 158 | #: C:\xampp\htdocs\wp\wp-content\plugins\wordpress-move/wordpress-move.php:557 159 | #: C:\xampp\htdocs\wp\wp-content\plugins\wordpress-move/wordpress-move.php:598 160 | msgid "Do not forget that..." 161 | msgstr "" 162 | 163 | #: C:\xampp\htdocs\wp\wp-content\plugins\wordpress-move/wordpress-move.php:516 164 | msgid "Your files and database will not be transferred to another server." 165 | msgstr "" 166 | 167 | #: C:\xampp\htdocs\wp\wp-content\plugins\wordpress-move/wordpress-move.php:517 168 | msgid "Only instances of your old domain name in the database will be replaced." 169 | msgstr "" 170 | 171 | #: C:\xampp\htdocs\wp\wp-content\plugins\wordpress-move/wordpress-move.php:518 172 | msgid "You need to manually configure your server and new domain name to use it on this server." 173 | msgstr "" 174 | 175 | #: C:\xampp\htdocs\wp\wp-content\plugins\wordpress-move/wordpress-move.php:519 176 | msgid "A backup of your database will be made available under the backup directory." 177 | msgstr "" 178 | 179 | #: C:\xampp\htdocs\wp\wp-content\plugins\wordpress-move/wordpress-move.php:520 180 | msgid "Creating a manual backup of your database is still highly encouraged." 181 | msgstr "" 182 | 183 | #: C:\xampp\htdocs\wp\wp-content\plugins\wordpress-move/wordpress-move.php:525 184 | #: C:\xampp\htdocs\wp\wp-content\plugins\wordpress-move/wordpress-move.php:567 185 | #: C:\xampp\htdocs\wp\wp-content\plugins\wordpress-move/wordpress-move.php:606 186 | msgid "Begin" 187 | msgstr "" 188 | 189 | #: C:\xampp\htdocs\wp\wp-content\plugins\wordpress-move/wordpress-move.php:543 190 | #: C:\xampp\htdocs\wp\wp-content\plugins\wordpress-move/wordpress-move.php:585 191 | msgid "If you wish to do one or more of the following..." 192 | msgstr "" 193 | 194 | #: C:\xampp\htdocs\wp\wp-content\plugins\wordpress-move/wordpress-move.php:546 195 | msgid "Transfer your database to another server.\t" 196 | msgstr "" 197 | 198 | #: C:\xampp\htdocs\wp\wp-content\plugins\wordpress-move/wordpress-move.php:547 199 | msgid "Transfer some/all of your files to another server." 200 | msgstr "" 201 | 202 | #: C:\xampp\htdocs\wp\wp-content\plugins\wordpress-move/wordpress-move.php:548 203 | msgid "Use a different domain name on the target server." 204 | msgstr "" 205 | 206 | #: C:\xampp\htdocs\wp\wp-content\plugins\wordpress-move/wordpress-move.php:551 207 | #: C:\xampp\htdocs\wp\wp-content\plugins\wordpress-move/wordpress-move.php:592 208 | msgid "Make sure that..." 209 | msgstr "" 210 | 211 | #: C:\xampp\htdocs\wp\wp-content\plugins\wordpress-move/wordpress-move.php:554 212 | msgid "WordPress and WordPress Move are installed on the target server." 213 | msgstr "" 214 | 215 | #: C:\xampp\htdocs\wp\wp-content\plugins\wordpress-move/wordpress-move.php:560 216 | msgid "This installation will stay as-is after the operation." 217 | msgstr "" 218 | 219 | #: C:\xampp\htdocs\wp\wp-content\plugins\wordpress-move/wordpress-move.php:561 220 | msgid "You need to configure the plugin using the WordPress Move page under the Settings menu." 221 | msgstr "" 222 | 223 | #: C:\xampp\htdocs\wp\wp-content\plugins\wordpress-move/wordpress-move.php:562 224 | msgid "You need to manually configure your existing domain to use it on the target server." 225 | msgstr "" 226 | 227 | #: C:\xampp\htdocs\wp\wp-content\plugins\wordpress-move/wordpress-move.php:588 228 | msgid "Complete migrating to this server." 229 | msgstr "" 230 | 231 | #: C:\xampp\htdocs\wp\wp-content\plugins\wordpress-move/wordpress-move.php:589 232 | msgid "Restore backup files listed under the Current Backups section of the Backup Manager." 233 | msgstr "" 234 | 235 | #: C:\xampp\htdocs\wp\wp-content\plugins\wordpress-move/wordpress-move.php:595 236 | msgid "You have backup files to use for this process under the backup directory." 237 | msgstr "" 238 | 239 | #: C:\xampp\htdocs\wp\wp-content\plugins\wordpress-move/wordpress-move.php:601 240 | msgid "Backups will be processed starting from old to new." 241 | msgstr "" 242 | 243 | #: C:\xampp\htdocs\wp\wp-content\plugins\wordpress-move/wordpress-move.php:664 244 | #: C:\xampp\htdocs\wp\wp-content\plugins\wordpress-move/wordpress-move.php:1031 245 | #: C:\xampp\htdocs\wp\wp-content\plugins\wordpress-move/wordpress-move.php:1045 246 | #: C:\xampp\htdocs\wp\wp-content\plugins\wordpress-move/wordpress-move.php:1140 247 | #: C:\xampp\htdocs\wp\wp-content\plugins\wordpress-move/wordpress-move.php:1160 248 | msgid "Success!" 249 | msgstr "" 250 | 251 | #: C:\xampp\htdocs\wp\wp-content\plugins\wordpress-move/wordpress-move.php:666 252 | msgid "Your domain name has been changed successfully." 253 | msgstr "" 254 | 255 | #: C:\xampp\htdocs\wp\wp-content\plugins\wordpress-move/wordpress-move.php:667 256 | #, php-format 257 | msgid "Click here to go to your site using your new domain." 258 | msgstr "" 259 | 260 | #: C:\xampp\htdocs\wp\wp-content\plugins\wordpress-move/wordpress-move.php:680 261 | msgid "Failure!" 262 | msgstr "" 263 | 264 | #: C:\xampp\htdocs\wp\wp-content\plugins\wordpress-move/wordpress-move.php:684 265 | msgid "An error occured while changing instances of your domain name." 266 | msgstr "" 267 | 268 | #: C:\xampp\htdocs\wp\wp-content\plugins\wordpress-move/wordpress-move.php:704 269 | msgid "Changes on your domain has been rolled back automatically." 270 | msgstr "" 271 | 272 | #: C:\xampp\htdocs\wp\wp-content\plugins\wordpress-move/wordpress-move.php:712 273 | msgid "Rolling back to the previous state also failed. Please try importing the database backup stored under the backup folder manually." 274 | msgstr "" 275 | 276 | #: C:\xampp\htdocs\wp\wp-content\plugins\wordpress-move/wordpress-move.php:731 277 | msgid "Changing Domain Name" 278 | msgstr "" 279 | 280 | #: C:\xampp\htdocs\wp\wp-content\plugins\wordpress-move/wordpress-move.php:733 281 | msgid "Please enter exact paths to your WordPress installations on both domains without the trailing slash. After replacing instances of your old domain name in the database with the new one completes, please do not forget to update your nameservers." 282 | msgstr "" 283 | 284 | #: C:\xampp\htdocs\wp\wp-content\plugins\wordpress-move/wordpress-move.php:739 285 | #: C:\xampp\htdocs\wp\wp-content\plugins\wordpress-move/wordpress-move.php:927 286 | msgid "Old Domain Name" 287 | msgstr "" 288 | 289 | #: C:\xampp\htdocs\wp\wp-content\plugins\wordpress-move/wordpress-move.php:747 290 | #: C:\xampp\htdocs\wp\wp-content\plugins\wordpress-move/wordpress-move.php:935 291 | msgid "New Domain Name" 292 | msgstr "" 293 | 294 | #: C:\xampp\htdocs\wp\wp-content\plugins\wordpress-move/wordpress-move.php:756 295 | msgid "Change" 296 | msgstr "" 297 | 298 | #: C:\xampp\htdocs\wp\wp-content\plugins\wordpress-move/wordpress-move.php:839 299 | msgid "Could not create backup files. Please make sure the backup directory is writable. For further info, please refer to the documentation." 300 | msgstr "" 301 | 302 | #: C:\xampp\htdocs\wp\wp-content\plugins\wordpress-move/wordpress-move.php:847 303 | msgid "Creating and uploading backups have been completed. You can now go to your new installation and run the migration assistant in Complete Migration mode." 304 | msgstr "" 305 | 306 | #: C:\xampp\htdocs\wp\wp-content\plugins\wordpress-move/wordpress-move.php:856 307 | msgid "Please check your FTP connection details on the settings page." 308 | msgstr "" 309 | 310 | #: C:\xampp\htdocs\wp\wp-content\plugins\wordpress-move/wordpress-move.php:873 311 | msgid "Please select the files you want to include in the backup from the list below." 312 | msgstr "" 313 | 314 | #: C:\xampp\htdocs\wp\wp-content\plugins\wordpress-move/wordpress-move.php:882 315 | msgid "Start Migration" 316 | msgstr "" 317 | 318 | #: C:\xampp\htdocs\wp\wp-content\plugins\wordpress-move/wordpress-move.php:902 319 | msgid "If your FTP account uses a password, please enter it below." 320 | msgstr "" 321 | 322 | #: C:\xampp\htdocs\wp\wp-content\plugins\wordpress-move/wordpress-move.php:904 323 | msgid "FTP Password:" 324 | msgstr "" 325 | 326 | #: C:\xampp\htdocs\wp\wp-content\plugins\wordpress-move/wordpress-move.php:921 327 | msgid "Please enter the exact path to your WordPress installation on your new domain name without the trailing slash and then click Start Migration button to start the migration process." 328 | msgstr "" 329 | 330 | #: C:\xampp\htdocs\wp\wp-content\plugins\wordpress-move/wordpress-move.php:957 331 | msgid "Select All" 332 | msgstr "" 333 | 334 | #: C:\xampp\htdocs\wp\wp-content\plugins\wordpress-move/wordpress-move.php:958 335 | msgid "Unselect All" 336 | msgstr "" 337 | 338 | #: C:\xampp\htdocs\wp\wp-content\plugins\wordpress-move/wordpress-move.php:978 339 | msgid "Loading..." 340 | msgstr "" 341 | 342 | #: C:\xampp\htdocs\wp\wp-content\plugins\wordpress-move/wordpress-move.php:1022 343 | #, php-format 344 | msgid "Connecting to %s:%d..." 345 | msgstr "" 346 | 347 | #: C:\xampp\htdocs\wp\wp-content\plugins\wordpress-move/wordpress-move.php:1036 348 | #, php-format 349 | msgid "Logging in as %s using password..." 350 | msgstr "" 351 | 352 | #: C:\xampp\htdocs\wp\wp-content\plugins\wordpress-move/wordpress-move.php:1038 353 | #, php-format 354 | msgid "Logging in as %s without a password..." 355 | msgstr "" 356 | 357 | #: C:\xampp\htdocs\wp\wp-content\plugins\wordpress-move/wordpress-move.php:1045 358 | msgid "Starting uploading files..." 359 | msgstr "" 360 | 361 | #: C:\xampp\htdocs\wp\wp-content\plugins\wordpress-move/wordpress-move.php:1057 362 | #, php-format 363 | msgid "%s is being uploaded..." 364 | msgstr "" 365 | 366 | #: C:\xampp\htdocs\wp\wp-content\plugins\wordpress-move/wordpress-move.php:1060 367 | msgid " Success!" 368 | msgstr "" 369 | 370 | #: C:\xampp\htdocs\wp\wp-content\plugins\wordpress-move/wordpress-move.php:1062 371 | #: C:\xampp\htdocs\wp\wp-content\plugins\wordpress-move/wordpress-move.php:1091 372 | msgid " Failed!" 373 | msgstr "" 374 | 375 | #: C:\xampp\htdocs\wp\wp-content\plugins\wordpress-move/wordpress-move.php:1070 376 | #, php-format 377 | msgid "Uploading files is completed with %d error..." 378 | msgstr "" 379 | 380 | #: C:\xampp\htdocs\wp\wp-content\plugins\wordpress-move/wordpress-move.php:1072 381 | msgid "Uploading files is completed without an error..." 382 | msgstr "" 383 | 384 | #: C:\xampp\htdocs\wp\wp-content\plugins\wordpress-move/wordpress-move.php:1077 385 | msgid "Closing the FTP connection..." 386 | msgstr "" 387 | 388 | #: C:\xampp\htdocs\wp\wp-content\plugins\wordpress-move/wordpress-move.php:1091 389 | msgid "Operation terminated..." 390 | msgstr "" 391 | 392 | #: C:\xampp\htdocs\wp\wp-content\plugins\wordpress-move/wordpress-move.php:1113 393 | #: C:\xampp\htdocs\wp\wp-content\plugins\wordpress-move/wordpress-move.php:1193 394 | msgid "Completing Migration" 395 | msgstr "" 396 | 397 | #: C:\xampp\htdocs\wp\wp-content\plugins\wordpress-move/wordpress-move.php:1133 398 | #, php-format 399 | msgid "%s is being imported..." 400 | msgstr "" 401 | 402 | #: C:\xampp\htdocs\wp\wp-content\plugins\wordpress-move/wordpress-move.php:1143 403 | #: C:\xampp\htdocs\wp\wp-content\plugins\wordpress-move/wordpress-move.php:1163 404 | msgid "Failed!" 405 | msgstr "" 406 | 407 | #: C:\xampp\htdocs\wp\wp-content\plugins\wordpress-move/wordpress-move.php:1145 408 | #: C:\xampp\htdocs\wp\wp-content\plugins\wordpress-move/wordpress-move.php:1165 409 | msgid "Check file permissions..." 410 | msgstr "" 411 | 412 | #: C:\xampp\htdocs\wp\wp-content\plugins\wordpress-move/wordpress-move.php:1153 413 | #, php-format 414 | msgid "%s is being extracted..." 415 | msgstr "" 416 | 417 | #: C:\xampp\htdocs\wp\wp-content\plugins\wordpress-move/wordpress-move.php:1175 418 | msgid "Please select files to migrate before proceeding!" 419 | msgstr "" 420 | 421 | #: C:\xampp\htdocs\wp\wp-content\plugins\wordpress-move/wordpress-move.php:1179 422 | #, php-format 423 | msgid "Migration has been completed but with %d error." 424 | msgstr "" 425 | 426 | #: C:\xampp\htdocs\wp\wp-content\plugins\wordpress-move/wordpress-move.php:1181 427 | msgid "Migration has been completed successfully!" 428 | msgstr "" 429 | 430 | #: C:\xampp\htdocs\wp\wp-content\plugins\wordpress-move/wordpress-move.php:1203 431 | msgid "Below are the files stored under the main backup directory. Please select backup files below to proceed." 432 | msgstr "" 433 | 434 | #: C:\xampp\htdocs\wp\wp-content\plugins\wordpress-move/wordpress-move.php:1213 435 | #: C:\xampp\htdocs\wp\wp-content\plugins\wordpress-move/wordpress-move.php:1232 436 | #: C:\xampp\htdocs\wp\wp-content\plugins\wordpress-move/wordpress-move.php:1440 437 | #: C:\xampp\htdocs\wp\wp-content\plugins\wordpress-move/wordpress-move.php:1459 438 | #: C:\xampp\htdocs\wp\wp-content\plugins\wordpress-move/wordpress-move.php:1566 439 | #: C:\xampp\htdocs\wp\wp-content\plugins\wordpress-move/wordpress-move.php:1585 440 | #: C:\xampp\htdocs\wp\wp-content\plugins\wordpress-move/wordpress-move.php:1690 441 | #: C:\xampp\htdocs\wp\wp-content\plugins\wordpress-move/wordpress-move.php:1709 442 | msgid "Name" 443 | msgstr "" 444 | 445 | #: C:\xampp\htdocs\wp\wp-content\plugins\wordpress-move/wordpress-move.php:1216 446 | #: C:\xampp\htdocs\wp\wp-content\plugins\wordpress-move/wordpress-move.php:1235 447 | #: C:\xampp\htdocs\wp\wp-content\plugins\wordpress-move/wordpress-move.php:1443 448 | #: C:\xampp\htdocs\wp\wp-content\plugins\wordpress-move/wordpress-move.php:1462 449 | #: C:\xampp\htdocs\wp\wp-content\plugins\wordpress-move/wordpress-move.php:1569 450 | #: C:\xampp\htdocs\wp\wp-content\plugins\wordpress-move/wordpress-move.php:1588 451 | #: C:\xampp\htdocs\wp\wp-content\plugins\wordpress-move/wordpress-move.php:1693 452 | #: C:\xampp\htdocs\wp\wp-content\plugins\wordpress-move/wordpress-move.php:1712 453 | msgid "Type" 454 | msgstr "" 455 | 456 | #: C:\xampp\htdocs\wp\wp-content\plugins\wordpress-move/wordpress-move.php:1219 457 | #: C:\xampp\htdocs\wp\wp-content\plugins\wordpress-move/wordpress-move.php:1238 458 | #: C:\xampp\htdocs\wp\wp-content\plugins\wordpress-move/wordpress-move.php:1446 459 | #: C:\xampp\htdocs\wp\wp-content\plugins\wordpress-move/wordpress-move.php:1465 460 | #: C:\xampp\htdocs\wp\wp-content\plugins\wordpress-move/wordpress-move.php:1572 461 | #: C:\xampp\htdocs\wp\wp-content\plugins\wordpress-move/wordpress-move.php:1591 462 | #: C:\xampp\htdocs\wp\wp-content\plugins\wordpress-move/wordpress-move.php:1696 463 | #: C:\xampp\htdocs\wp\wp-content\plugins\wordpress-move/wordpress-move.php:1715 464 | msgid "Size" 465 | msgstr "" 466 | 467 | #: C:\xampp\htdocs\wp\wp-content\plugins\wordpress-move/wordpress-move.php:1222 468 | #: C:\xampp\htdocs\wp\wp-content\plugins\wordpress-move/wordpress-move.php:1241 469 | #: C:\xampp\htdocs\wp\wp-content\plugins\wordpress-move/wordpress-move.php:1449 470 | #: C:\xampp\htdocs\wp\wp-content\plugins\wordpress-move/wordpress-move.php:1468 471 | #: C:\xampp\htdocs\wp\wp-content\plugins\wordpress-move/wordpress-move.php:1575 472 | #: C:\xampp\htdocs\wp\wp-content\plugins\wordpress-move/wordpress-move.php:1594 473 | #: C:\xampp\htdocs\wp\wp-content\plugins\wordpress-move/wordpress-move.php:1699 474 | #: C:\xampp\htdocs\wp\wp-content\plugins\wordpress-move/wordpress-move.php:1718 475 | msgid "Date Created" 476 | msgstr "" 477 | 478 | #: C:\xampp\htdocs\wp\wp-content\plugins\wordpress-move/wordpress-move.php:1259 479 | #: C:\xampp\htdocs\wp\wp-content\plugins\wordpress-move/wordpress-move.php:1490 480 | #: C:\xampp\htdocs\wp\wp-content\plugins\wordpress-move/wordpress-move.php:1616 481 | #: C:\xampp\htdocs\wp\wp-content\plugins\wordpress-move/wordpress-move.php:1740 482 | msgid "Database Backup" 483 | msgstr "" 484 | 485 | #: C:\xampp\htdocs\wp\wp-content\plugins\wordpress-move/wordpress-move.php:1262 486 | #: C:\xampp\htdocs\wp\wp-content\plugins\wordpress-move/wordpress-move.php:1493 487 | #: C:\xampp\htdocs\wp\wp-content\plugins\wordpress-move/wordpress-move.php:1619 488 | msgid "Filesystem Backup" 489 | msgstr "" 490 | 491 | #: C:\xampp\htdocs\wp\wp-content\plugins\wordpress-move/wordpress-move.php:1303 492 | msgid "Complete Migration" 493 | msgstr "" 494 | 495 | #: C:\xampp\htdocs\wp\wp-content\plugins\wordpress-move/wordpress-move.php:1309 496 | msgid "There are no backup files to use to complete the migration. Please start the migration using WordPress Move on the server you want to migrate from." 497 | msgstr "" 498 | 499 | #: C:\xampp\htdocs\wp\wp-content\plugins\wordpress-move/wordpress-move.php:1389 500 | #: C:\xampp\htdocs\wp\wp-content\plugins\wordpress-move/wordpress-move.php:1812 501 | msgid "Backup Manager" 502 | msgstr "" 503 | 504 | #: C:\xampp\htdocs\wp\wp-content\plugins\wordpress-move/wordpress-move.php:1389 505 | #: C:\xampp\htdocs\wp\wp-content\plugins\wordpress-move/wordpress-move.php:1390 506 | msgid "Backup Now" 507 | msgstr "" 508 | 509 | #: C:\xampp\htdocs\wp\wp-content\plugins\wordpress-move/wordpress-move.php:1392 510 | msgid "You can always create backups of your WordPress installation to use as restoration points. Select one of the methods below to create a quick backup." 511 | msgstr "" 512 | 513 | #: C:\xampp\htdocs\wp\wp-content\plugins\wordpress-move/wordpress-move.php:1398 514 | msgid "Create a Database Backup" 515 | msgstr "" 516 | 517 | #: C:\xampp\htdocs\wp\wp-content\plugins\wordpress-move/wordpress-move.php:1400 518 | msgid "Create a Full Backup" 519 | msgstr "" 520 | 521 | #: C:\xampp\htdocs\wp\wp-content\plugins\wordpress-move/wordpress-move.php:1404 522 | msgid "Current Backups" 523 | msgstr "" 524 | 525 | #: C:\xampp\htdocs\wp\wp-content\plugins\wordpress-move/wordpress-move.php:1406 526 | msgid "Below are the files stored under your backup directory. These files will be used if you choose to complete the migration." 527 | msgstr "" 528 | 529 | #: C:\xampp\htdocs\wp\wp-content\plugins\wordpress-move/wordpress-move.php:1426 530 | msgid "Archive" 531 | msgstr "" 532 | 533 | #: C:\xampp\htdocs\wp\wp-content\plugins\wordpress-move/wordpress-move.php:1427 534 | #: C:\xampp\htdocs\wp\wp-content\plugins\wordpress-move/wordpress-move.php:1553 535 | msgid "Convert" 536 | msgstr "" 537 | 538 | #: C:\xampp\htdocs\wp\wp-content\plugins\wordpress-move/wordpress-move.php:1428 539 | #: C:\xampp\htdocs\wp\wp-content\plugins\wordpress-move/wordpress-move.php:1554 540 | #: C:\xampp\htdocs\wp\wp-content\plugins\wordpress-move/wordpress-move.php:1678 541 | msgid "Delete" 542 | msgstr "" 543 | 544 | #: C:\xampp\htdocs\wp\wp-content\plugins\wordpress-move/wordpress-move.php:1430 545 | #: C:\xampp\htdocs\wp\wp-content\plugins\wordpress-move/wordpress-move.php:1556 546 | #: C:\xampp\htdocs\wp\wp-content\plugins\wordpress-move/wordpress-move.php:1680 547 | msgid "Apply" 548 | msgstr "" 549 | 550 | #: C:\xampp\htdocs\wp\wp-content\plugins\wordpress-move/wordpress-move.php:1533 551 | #: C:\xampp\htdocs\wp\wp-content\plugins\wordpress-move/wordpress-move.php:1659 552 | msgid "No backup files found." 553 | msgstr "" 554 | 555 | #: C:\xampp\htdocs\wp\wp-content\plugins\wordpress-move/wordpress-move.php:1542 556 | msgid "Old Backups" 557 | msgstr "" 558 | 559 | #: C:\xampp\htdocs\wp\wp-content\plugins\wordpress-move/wordpress-move.php:1544 560 | msgid "Below are the files stored under your old backup directory. These files will not be used while completing the migration unless you unarchive them." 561 | msgstr "" 562 | 563 | #: C:\xampp\htdocs\wp\wp-content\plugins\wordpress-move/wordpress-move.php:1552 564 | msgid "Unarchive" 565 | msgstr "" 566 | 567 | #: C:\xampp\htdocs\wp\wp-content\plugins\wordpress-move/wordpress-move.php:1668 568 | msgid "Converted Database Backups" 569 | msgstr "" 570 | 571 | #: C:\xampp\htdocs\wp\wp-content\plugins\wordpress-move/wordpress-move.php:1670 572 | msgid "Below are the converted database backup files which, unlike the files listed above, can be used outside WordPress Move. You may need the converted versions of your databsae backups if the plugin fails to migrate your installation properly. These files will not be used by the plugin at any stage." 573 | msgstr "" 574 | 575 | #: C:\xampp\htdocs\wp\wp-content\plugins\wordpress-move/wordpress-move.php:1779 576 | msgid "No converted database backup files found. You can convert a database backup file using the Convert option from the dropdown lists above." 577 | msgstr "" 578 | 579 | #: C:\xampp\htdocs\wp\wp-content\plugins\wordpress-move/wordpress-move.php:1815 580 | msgid "Settings" 581 | msgstr "" 582 | 583 | #: C:\xampp\htdocs\wp\wp-content\plugins\wordpress-move/wordpress-move.php:1815 584 | msgid "WordPress Move" 585 | msgstr "" 586 | 587 | -------------------------------------------------------------------------------- /libs/functions-database-backup.php: -------------------------------------------------------------------------------- 1 | query( 'SHOW TABLES' ); 79 | $row = $wpdb->get_results( 'SHOW TABLES', ARRAY_N ); 80 | 81 | for ( $i = 0; $i < $cnt; $i++ ) 82 | $tables[$i] = $row[$i][0]; 83 | 84 | foreach ( $tables as $table ) { 85 | 86 | $cnt_fields = $wpdb->query( 'SELECT * FROM ' . $table ); 87 | 88 | array_push( $queries, "DROP TABLE IF EXISTS " . $table . ";" ); 89 | 90 | $res = $wpdb->get_results( 'SHOW CREATE TABLE ' . $table, ARRAY_N ); 91 | array_push( $queries, $res[0][1] . ";" ); 92 | 93 | $row = $wpdb->get_results( 'SELECT * FROM ' . $table, ARRAY_N ); 94 | 95 | for ( $i = 0; $i < $cnt_fields; $i++ ) { 96 | 97 | if ( $chunk_size > 0 && strlen( serialize( $queries ) ) > ( $chunk_size * 1024 * 1024 ) ) { 98 | fwrite( $output, serialize( $queries ) ); 99 | fclose( $output ); 100 | $queries = array(); 101 | $filename = 'DBBackup-' . time() . $chunk_id++ . '.sql'; 102 | $output = fopen( trailingslashit( WPMOVE_BACKUP_DIR ) . $filename, 'w+' ); 103 | array_push( $filenames, $filename ); 104 | } 105 | 106 | $query = "INSERT INTO " . $table . " VALUES( "; 107 | 108 | $j = 0; 109 | 110 | $values = array(); 111 | 112 | while ( array_key_exists( $j, $row[$i] ) ) { 113 | 114 | if ( strstr( $row[$i][$j], '_site_transient_' ) || strstr( $row[$i][$j], '_transient_' ) ) 115 | continue 2; 116 | 117 | if ( is_int( $row[$i][$j] ) ) 118 | $query .= "%d, "; 119 | else 120 | $query .= "%s, "; 121 | 122 | if ( $replacement_mode ) 123 | array_push( $values, wpmove_replace_url( $old_url, $new_url, $row[$i][$j] ) ); 124 | else 125 | array_push( $values, $row[$i][$j] ); 126 | 127 | $j++; 128 | } 129 | 130 | $query = substr( $query, 0, strlen( $query ) - 2 ); 131 | 132 | $query .= " ); "; 133 | 134 | array_push( $queries, $wpdb->prepare( $query, $values ) ); 135 | } 136 | } 137 | 138 | fwrite( $output, serialize( $queries ) ); 139 | fclose( $output ); 140 | 141 | return $filenames; 142 | } 143 | 144 | /** 145 | * Imports the database backup. 146 | * 147 | * @param string $filename Name of the backup file 148 | * @return void 149 | */ 150 | function wpmove_import_db_backup( $filename ) { 151 | 152 | global $wpdb; 153 | 154 | $filename = trailingslashit( WPMOVE_BACKUP_DIR ) . $filename; 155 | 156 | $sql = file_get_contents( $filename ); 157 | 158 | $queries = unserialize( $sql ); 159 | 160 | if ( is_array( $queries ) ) 161 | foreach ( $queries as $query ) 162 | $wpdb->query( $query ); 163 | else 164 | return FALSE; 165 | 166 | return TRUE; 167 | } 168 | 169 | /** 170 | * Downloads the database backup. 171 | * 172 | * @param string $filename Filename of the backup file 173 | * @return int 0 If file does not exist 174 | * @return int 1 On success 175 | */ 176 | function wpmove_download_db_backup( $filename ) { 177 | 178 | if ( file_exists( $filename ) ) { 179 | header( 'Content-type: text/plain' ); 180 | header( 'Content-Disposition: attachment; filename=' . $filename ); 181 | readfile( $filename ); 182 | return 1; 183 | } 184 | 185 | return 0; 186 | } 187 | 188 | /** 189 | * Lists database backups. 190 | * 191 | * @param void 192 | * @return void 193 | */ 194 | function wpmove_list_db_backups() { 195 | 196 | $files = scandir( '.' ); 197 | 198 | for ( $i = 0; $i < count( $files ); $i++ ) 199 | if ( preg_match( "^DBBackup-([0-9]*).sql^", $files[$i] ) ) 200 | echo $files[$i] . "\t" . filesize( $files[$i] ) . "
"; 201 | } 202 | 203 | /** 204 | * Removes the database backup. 205 | * 206 | * @param string $filename Filename of the backup file 207 | * @param string $directory Directory the file is inside of (optional) 208 | * @return void 209 | */ 210 | function wpmove_remove_db_backup( $filename, $directory = NULL ) { 211 | 212 | if ( $directory ) 213 | $filename = $directory . $filename; 214 | else 215 | $filename = trailingslashit( WPMOVE_BACKUP_DIR ) . $filename; 216 | 217 | if ( file_exists( $filename ) ) 218 | unlink( $filename ); 219 | } 220 | 221 | /** 222 | * Replaces instances of first argument with 223 | * the second one inside the serialized string. 224 | * 225 | * @param string $find URL to replace 226 | * @param string $replace URL to replace with 227 | * @param string $option String to search within 228 | * @return string Replaced string 229 | */ 230 | function wpmove_replace_url( $find, $replace, $option ){ 231 | 232 | if ( is_serialized( $option ) ) { 233 | 234 | $option = unserialize( $option ); 235 | 236 | if ( is_array( $option ) ) 237 | foreach ( $option as $key => $val ) 238 | $option[$key] = wpmove_replace_url( $find, $replace, $val ); 239 | 240 | $option = serialize( $option ); 241 | 242 | } else { 243 | 244 | if ( is_array( $option ) ) 245 | foreach ( $option as $key => $val ) 246 | $option[$key] = wpmove_replace_url( $find, $replace, $val ); 247 | elseif ( is_string( $option ) ) 248 | $option = str_replace( $find, $replace, $option ); 249 | } 250 | 251 | return $option; 252 | } 253 | ?> 254 | -------------------------------------------------------------------------------- /libs/functions-file-backup.php: -------------------------------------------------------------------------------- 1 | add( $files, PCLZIP_OPT_REMOVE_PATH, $ommit_path ); 23 | return basename( $filename ); 24 | } 25 | 26 | /** 27 | * Extracts the given archive to the given destination. 28 | * 29 | * @param string $filename Archive to extract 30 | * @param string $destination Directory to extract to 31 | * @return array 32 | */ 33 | function wpmove_extract_archive( $filename, $destination ) { 34 | $archive = new PclZip( trailingslashit( WPMOVE_BACKUP_DIR ) . $filename ); 35 | return $archive->extract( PCLZIP_OPT_PATH, $destination ); 36 | } 37 | 38 | /** 39 | * Calculates the total disk space the given directory uses. 40 | * 41 | * @param string $directory Directory to calculate the disk usage of 42 | * @return integer $totalUsage The disk space given directory uses 43 | */ 44 | function wpmove_calculate_total_usage( $directory ) { 45 | 46 | if ( is_file( $directory) ) 47 | return filesize( $directory ); 48 | 49 | $totalUsage = 0; 50 | 51 | if ( is_array( $fileList = glob( $directory . "/*" ) ) ) 52 | foreach ( $fileList as $file ) 53 | $totalUsage += calculateTotalUsage( $file ); 54 | 55 | return $totalUsage; 56 | } 57 | 58 | /** 59 | * Creates a list of all the files under the given directory. 60 | * 61 | * @param string $directory Directory to list the files of 62 | * @param bool $ignore_directories Ignores sub directories if set to TRUE 63 | * @param array $ommit Array of directories to ommit 64 | * @return array $files File list 65 | */ 66 | function wpmove_list_all_files( $directory, $ignore_directories = FALSE, $ommit = array() ) { 67 | 68 | $files = array(); 69 | 70 | if ( is_array( $fileList = glob( $directory . "/*" ) ) ) 71 | foreach ( $fileList as $file ) { 72 | if ( is_file( $file ) ) { 73 | array_push( $files, $file ); 74 | } elseif ( ! $ignore_directories ) { 75 | $skip = FALSE; 76 | foreach ( $ommit as $dir ) 77 | if ( $file == $dir ) 78 | $skip = TRUE; 79 | if ( ! $skip ) 80 | if ( count( @scandir( $file ) ) > 2 ) 81 | $files = array_merge( $files, wpmove_list_all_files( $file, FALSE, $ommit ) ); 82 | else 83 | array_push( $files, $file ); 84 | } 85 | } 86 | 87 | return $files; 88 | } 89 | 90 | /** 91 | * Generates a classic file tree. 92 | * 93 | * @param string $directory Directory to list the files of 94 | * @param bool $ignore_directories Ignores sub directories if set to TRUE 95 | * @return array $tree Generated tree 96 | */ 97 | function wpmove_generate_file_tree( $directory, $ignore_directories = FALSE, $ommit = array() ) { 98 | 99 | $files = array(); 100 | $directories = array(); 101 | 102 | if ( is_array( $fileList = glob( $directory . "/*" ) ) ) 103 | foreach ( $fileList as $file ) { 104 | if ( is_file( $file ) ) { 105 | array_push( $files, $file ); 106 | } elseif ( ! $ignore_directories ) { 107 | $skip = FALSE; 108 | foreach ( $ommit as $dir ) 109 | if ( $file == $dir ) 110 | $skip = TRUE; 111 | if ( ! $skip ) { 112 | array_push( $directories, $file ); 113 | array_push( $directories, wpmove_generate_file_tree( $file, FALSE, $ommit ) ); 114 | } 115 | } 116 | } 117 | 118 | $tree = array_merge( $directories, $files ); 119 | 120 | return $tree; 121 | } 122 | 123 | /** 124 | * Creates lists of files by dividing files inside a directory into chunks. 125 | * 126 | * @param array $files Files to divide into chunks 127 | * @param integer $chunk_size Size of chunks in bytes 128 | * @return array $chunk File lists 129 | */ 130 | function wpmove_divide_into_chunks( $files, $chunk_size ) { 131 | 132 | $chunk[0] = array(); 133 | $currentChunk = 0; 134 | $currentSize = 0; 135 | $chunk_size = $chunk_size * 1024 * 1024; 136 | 137 | foreach ( $files as $file ) { 138 | if ( ( $currentSize + filesize( $file ) <= $chunk_size ) ) { 139 | array_push( $chunk[$currentChunk], $file ); 140 | $currentSize += filesize( $file ); 141 | } else { 142 | $currentChunk++; 143 | $currentSize = 0; 144 | $chunk[$currentChunk] = array(); 145 | array_push( $chunk[$currentChunk], $file ); 146 | } 147 | } 148 | 149 | return $chunk; 150 | } 151 | 152 | /** 153 | * Displays the file tree using the given array of files 154 | * 155 | * @param array $files Array of files in a tree form 156 | * @return integer $i Updates counter to make sure every item has a unique ID 157 | */ 158 | function wpmove_display_file_tree( $files, $i=0 ) { 159 | 160 | foreach ( $files as $file ) { 161 | if ( ! is_array( $file ) ) 162 | if ( is_file( $file ) ) 163 | echo '
  • ' . basename( $file ) . '
  • '; 164 | elseif ( count( @scandir( $file ) ) > 2 ) 165 | echo '
  • ' . basename( $file ) . '