Moving contacts from one CiviCRM wordpress server to another server with different domain name

I had to move our WordPress CiviCRM install to a new server with a new domain, and decided that I wanted to do a fresh/clean install on the new server, and then I would import all the contacts from the old server.

In order for this method to be successful, here are some things I that I had to consider:

– Make sure to update both installs to the same version of CiviCRM.

– Make sure to go thru the CUSTOMIZE DATA AND SCREENS options, and you will need to add the items to the new install (such as Custom Fields, Profiles, Activity Types, etc) before you import anything, so that they match exactly with the old server.

– The import feature of CiviCRM only lets you import one type of contact at a time (Individual, Household or Organization), so when you export contacts from the old server you will need to split it into three exports, one for each type of contact. Do not export all types together, as you will not be able to import properly.

EXPORT
– To start the Export process, go to Find Contacts and choose the contact type you want and click SEARCH.
– Then you need to select the box that says ALL XYZ RECORDS. NOTE: For initial testing purposes, you might just want to select two or three contacts instead of all of them, so that you can test them to see if they export correctly, and if they import correctly on the new server. If the export or import does not work as expected, then you can make adjustments until the process it working correctly.
– Then choose EXPORT CONTACTS from the Actions drop down.
– Choose SELECT FIELDS FOR EXPORT, and if its your first time, you will leave the Use Saved Field Mapping blank (unless you have already saved a Field Mapping you want to use), and click CONTINUE.
– Now comes the most work! You will need to use the ADD FIELD button, and add every single field, one at a time. Make sure to use the SAVE FIELDS button often, and name it something like all_fields_organizations, so that if you need to do the export again, you have the field mapping already set up.
– Once you have the field mapping setup, click on DOWNLOAD FILE and you should have a CSV file with all your contacts of this type.

IMPORT
– Now login to your new server, and to start the Import process, look for Import Contacts under the Contacts menu.
– Choose your Contact Type to match what you exported.
– For Duplicate Contacts choose NO DUPLICATE CHECKING (this makes sure everything in your CSV file is imported).
– For Date Format, choose the mm/dd/yyyy option with the 4-digit year.
– If you have already mapped an import, you can use a Saved Field Mapping, or leave it blank if this is your first import.
– CiviCRM will try to match up the Column names with correct fields, but you need to verify if they are correct or not, and adjust them as necessary.
– For example, I set the following Columns as follows:
Addressee = Organization Name
Display Name = Organization Name
Sort Name = Organization Name
Organization Name = Organization Name
External Identifier = DO NOT IMPORT
Contact ID = External Identifier
– NOTE: On the old server, the External Identifier field was not being used. So I am putting the old servers Contact ID into the new servers External Identifier column. This allows me to have a reference for the contact in the old database.
– Save/Update your Field Mapping so you have it for later and click on CONTINUE. This will NOT import anything yet, but will give you a preview of what data will look like, and will also advise you if there are any errors in the CSV file that need to be fixed.
– Click IMPORT NOW when you are ready to import. Again, I recommend you just initially export a couple of contacts and try importing them to make sure the whole process works properly.

OPTIONAL STEP
When you import a contact in CiviCRM, both it’s Created Date and Modified Date get set to the date/time of import.
This last step may not be required for some of you, but for us, it was important the each Contacts CREATED DATE and LAST MODIFIED DATE remained the same as in the old database.
This requires a PHP script to pull those dates from the old database, and then another PHP script to update them in the new database.
In order for these scripts to work, it is important that we somehow associate the Contact ID from the old database with the new contact, and this where I set the Contact ID = External Identifier on the import mapping above.

OLD SERVER SCRIPT (see below)
This script will grab the Contact ID, Created Date and Modified Date of every contact in the database, and write them to a CSV file.

NEW SERVER SCRIPT (see below)
This script will read the CSV file above. It will then look at the Contact ID it read from the file, and see if there is a match in the External Identifier field. If it finds this match, it will then update the Created Date and Modified Date of the contact to match the old server dates.

MINOR ISSUE with BR tag
I noticed that one my custom fields (text/notes) imported line returns as & l t ; br / & g t ; [spaces added so it displays] and then there was extra < br / > tag visible/showing up in the text.
What I did was run an UPDATE with REPLACE on the specific column in that table and replace it with blank BEFORE I ran the NEW SERVER SCRIPT below.

 

OLD SERVER SCRIPT PHP CODE

// This script will get the Contact ID, Created Date and Modified Date of all contacts and write them to output.csv
$mysqli = new mysqli("localhost","db_user_name","db_password","db_name");
if ($mysqli -> connect_errno) {
  echo "Failed to connect to MySQL: " . $mysqli -> connect_error;
  exit();
}
echo "Connected to DB
"; if ($result = $mysqli -> query("SELECT id,modified_date,created_date FROM civicrm_contact ORDER BY id")) { echo "Number of rows found: " . $result -> num_rows."
"; if ($result -> num_rows > 0) { // FILE open $save_csv = "/path/to/public_html/output.csv"; // CHANGE ME ... Old server location wherever you put this script. Note that you have to move output.csv to the new server after its created. $csv_file_pointer = fopen($save_csv, "w"); // FILE Write CSV header $csv_data = "id,modified_date,created_date"; fwrite($csv_file_pointer, $csv_data.PHP_EOL); while ($row = $result->fetch_array()) { echo $row['id']." - ".$row['modified_date']." - ".$row['created_date']."
"; $csv_data = $row['id'].",".$row['modified_date'].",".$row['created_date']; // FILE Write CSV data fwrite($csv_file_pointer, $csv_data.PHP_EOL); } // FILE close fclose($csv_file_pointer); } } $mysqli -> close();

 

NEW SERVER SCRIPT PHP CODE

// This script will read output.csv file and then use the Contact ID from old database to look for a match in the new database External Identifer field. If a match is found, it will update the Created Date and Modified Date of the new contact to match the old database.
$mysqli = new mysqli("localhost","db_user","db_password","db_name");
if ($mysqli -> connect_errno) {
  echo "Failed to connect to MySQL: " . $mysqli -> connect_error;
  exit();
}
echo "Connected to DB
"; $file = fopen('/path/to/public_html/output.csv', 'r'); // CHANGE ME ... New server location wherever you put this script. Note that you have to move output.csv from the old server to this new server. while (($line = fgetcsv($file)) !== FALSE) { $extern_id = $line[0]; $modified_date = $line[1]; $created_date = $line[2]; if ($result = $mysqli -> query("SELECT id,modified_date,created_date FROM civicrm_contact WHERE external_identifier ='$extern_id' LIMIT 1 ")) { if ($result -> num_rows > 0) { //while ($row = $result->fetch_array()) { $row = $result->fetch_array(); $id = $row['id']; $old_modified_date = $row['modified_date']; $old_created_date = $row['created_date']; echo "FOUND id=$id with ext_id match=$extern_id :: old_mod=$old_modified_date old_created=$old_created_date new_mod=$modified_date new_created=$created_date"; // UPDATE here if ($result = $mysqli -> query("UPDATE civicrm_contact SET modified_date='$modified_date', created_date='$created_date' WHERE id='$id' ")) { echo " --UPDATED
"; } else { echo " --Error: could not update.
"; } //} } } } fclose($file); echo "
DONE
"; $mysqli -> close();

CallCentric VoIP Phone Provider Review

CallCentric VoIP Phone Provider Review

CLICK HERE for Official Site of CallCentric VoIP Phone Provider Review
Callcentric

If you are looking for a great VoIP company, I want to highly recommend CallCentric VoIP Phone Provider Review in this review.

They have very competitive prices, awesome service, and most importantly you can sign up for a FREE account and make unlimited free calls to other CallCentric customers for life.

VoIP stands for Voice Over Internet Protocol and basically means that CallCentric is phone service provider that uses the internet to make calls instead of using traditional copper phone lines. This results in huge savings on your monthly phone bill, especially when it comes to international long distance.

CLICK HERE for Official Site of CallCentric VoIP Phone Provider Review

For your personal phone, they can help you get up and running quickly with either your own device (BYOD) or can recommend different devices that have been tested with their service. And for business, they can help you with a simple single phone setup or with a complex PBX or Asterisk Server. They have several plans to choose from including pay-as-you-go and unlimited calling plans, and you can also choose your own phone number from a variety countries.

They have now also added new features such as IVR (automated attendants), SMS, multiple extensions, and more!

You have nothing to lose by trying their FREE service (no credit card required), so sign up today and you will not regret it!

From their website:

┬áImagine you have a phone number so callers can reach you whether you’re near or far; walking with a mobile phone, at home or the office, using VoIP or a regular phone line. And even more, this number is not in the country where you live.

Sign up now for CallCentric VoIP Phone Provider Review and try it before you buy it for free.

Callcentric
CLICK HERE for Official Site of CallCentric VoIP Phone Provider Review

MediaServe Web Hosting Review

In this review, I highly recommend MediaServe Web Hosting, especially if you are looking for a fantastic web hosting company.

They’re prices are very competitive (plans start at $5.00 per month), they have the best tech support, and you can try their service with a 30-day money back guarantee which means you have nothing to lose by signing up.

MediaServe offers “ridiculously affordable web hosting and video streaming“, which includes standard hosting plans, dedicated ip, ssl certificates, domain name registration, business class email service, free site builder utility and video hosting which includes Live and On-Demand services with Flash, iOS, Silverlight and Wowza Media Server.

I can’t stress enough how invaluable great technical support can be when hosting a website, and these guys have some of the best customer service I have ever worked with.

You have nothing to lose by signing for an account with their 30-day money back guarantee. Click here to go to their site now: MediaServe.com.

From their website:

Ridiculously Affordable Web Hosting and Video Streaming. Family owned and operated since 2002. Superior service and support. We host thousands of websites for clients in 39 countries. Despite its growth, MEDIASERVE retains the atmosphere and close client relationships typical of a smaller company.

We have cabinets full of servers colocated at the new Corexchange data center on Henry Hines Boulevard in Dallas, Texas. On Sundays while our church clients are broadcasting live, we tend to reach our peak throughput of approximately 500 mbps, which is only 50% of our gigabit connection. We use multi-processor, multi-core Dell and SuperMicro servers with dual power supplies on separate power circuits, and RAID storage for redundancy.

At MEDIASERVE, we provide an ample amount of storage to start with–10 gigabytes–with additional blocks of 10 gigabytes available at $5.00/month (or less with longer billing cycles.) Because we have negotiated some excellent bandwidth pricing, we offer unmetered bandwidth, meaning you don’t have to worry about your site traffic causing bandwidth exceeded errors or overage charges. What you’ll find is that some hosting companies will advertise ridiculous amounts of storage and bandwidth. Take one of our competitors for example. They advertise 600 gigabytes of storage, and 6,000 gigabytes of transfer. That’s 6 terrabytes of bandwidth usage! There is no possible way they can provide that to every customer. They know that each website consumes a tiny fraction of this amount, and they figure they can use huge numbers to hype their services. After all, who doesn’t like more for less? However, if every one of their customers were to actually use that storage and bandwidth, their servers would crash and they’d be out of business in a matter of days.

We refuse to engage in hype. What we advertise is actually available to every customer.

We also offer other great features such as the ability to host unlimited domain names, either parked or as completely independent sites, on a single hosting package. Unlimitied emails and email forwarders, unlimited MySQL databases, PHP, Perl and Ruby on Rails scripting, Fantastico for automatic script installation, highly tuned spam filtering and more are standard features, included at no additional cost.

Sign up today and take advantage of their great tech support and their 30-day money back guarantee offer: MediaServe