Skip to content

Class for fixing MySQL encoding mess, or simply for converting a MySQL database to a different encoding.

License

Notifications You must be signed in to change notification settings

akanevsky/php_convert_db

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 

Repository files navigation

What is PHP_Convert_DB

PHP_Convert_DB is a PHP script for converting a MySQL database from one encoding to a different one. It can also be used to straighten out encoding mess in your database. One example of when this might be useful is when you have cp1251 text stored in latin1 fields, and you are unable to manage any of your data through scripts like phpMyAdmin because all you see is weird characters.

Using PHP_Convert_DB v0.1

  • Dump your MySQL database structure (do not dump data)
  • In the dump, fix all encoding and collation declarations so that they are as you would like to see them in the migrated database
  • Import the fixed dump to a new blank database
  • Open sys_migrate.php and configure the class so that the settings match your setup
  • Run index.php, and all your data should be transferred over to the new database with the correct encoding

Enjoy!

Requirements:

  • Tested on: Apache
  • PHP 5.2+
  • MySQL 5+
  • PDO Extension for PHP (MySQL)

How to contribute

Please base all your pull requests and development off of the 'develop' branch. The master branch is tagged releases only.

Main Developers:

About

Class for fixing MySQL encoding mess, or simply for converting a MySQL database to a different encoding.

Resources

License

Stars

Watchers

Forks

Packages

No packages published