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

Overcoming Kajabi’s limited api webhooks and automations with a piped email automation

If you use Kajabi and you have wanted to setup some kind of external database to track progression and/or some kind external automation, you will find that the Kajabi API and the Kajabi Webhooks and the Kajabi Automations that they provide are limited in nature.

Problem: We wanted to provide a customized certificate (with their own name on it) after they had completed and passed 15 of our courses. Kajabi limitations mean that we could not accomplish this, and it would have to be tracked and done manually. Kajabi only allows for a generic certificate (not personalized) at the completeion of each course, and there was not way to do one certificate after the completion of multiple courses.

The solution then (I thought) would be to use Kajabi API or Webhooks to send an event (“user passed a course”) to an external database and then I can could create a custom script to check when they had passed all 15 courses, and then generate the certificate for them. However, neither the API nor the Webhooks allow you get information about users passing a course, so this was not going to work either.

Fortunately, kajabi’s automations had one “trick” that we could use to get the information we needed.

Solution: We ended up using an Automation of “Send Email” to a special email address that we created. This special email address uses a pipe to redirect the email directlu into a PHP program that will then parse the email, pull the information about user and course passed and then store that information in a database. So now we have an external database that tracks all courses passed by users, and I wrote another script that checks the database daily and looks for users that have passed all 15 courses, and then sends them a certificate.

SUMMARY:
So lets use example course called WIDGETS 101 with a FINAL EXAM ASSESSMENT:
– go to Marketing and then Automations and ADD NEW AUTOMATION
– choose WHEN ASSESSMENT IS COMPLETED and choose FINAL EXAM FOR WIDGETS 101
– choose THEN SEND AN EMAIL
– select send the email TO MY TEAM and use special piped email address you setup like kajabi-workflow@mydomain.com
– customize the SUBJECT to: EXAM PASSED WIDGETS 101
– customize the BODY to: start|EXAM PASSED|WIDGETS 101|{{first_name}}|{{last_name}}|{{email}}|end
– add a CONDITION of IF PASSED ANY OF THESE ASSESSMENTS and choose FINAL EXAM FOR WIDGETS 101
– APPLY the conidtion and SAVE the automation

The PHP script can now receive the email and parse the subject and body and get the info it needs to store in database.

Updating CiviCRM on WordPress

There are several steps when wanting to upgrade your CiviCRM install on WordPress. The official guide is here:
https://docs.civicrm.org/sysadmin/en/latest/upgrade/wordpress/

This is my simplified quick steps that work for me…

(1) Open browser and login to your CiviCRM install. Keep browser open during this entire process.

(2) Download most recent version of CiviCRM https://civicrm.org/download for WordPress onto your computer, and extract the civicrm folder from the zip/tar file.

(3) On your server, rename the /wp-content/plugins/civicrm folder to /wp-content/plugins/civicrmOLD

(4) On your server, move the /wp-content/plugins/civicrmOLD to /wp-content/civicrmOLD

(5) Upload the civicrm folder from your computer to your server into the /wp-content/plugins/ directory.

(6) Delete all the files in /wp-content/uploads/cicvcrm/templates_c/ directory.

(7) From browser, go to http://example.org/wp-admin/admin.php?page=CiviCRM&q=civicrm/upgrade&reset=1 to start the database upgrade.

(8) After complete, check that CivicCRM is working properly, and if it is you can then delete /wp-content/civicrmOLD folder and files.

Google Drive restricted file sharing still creates publicly accessible link – This is a critical security issue

I have come across a critical security issue with Google Drive file sharing.

When you set file sharing to “Restricted – Only people added can open with this link” then only people that you have specifically added should be able to view the document and they should be forced to login before they can view the document.

However, if you share the Restricted file with a non-Google email, you will get a poorly worded popup that asks you if you want to Share Anyway:

What is very unclear, is that if you click on Share Anyway, then a publicly accessible link is created that anybody can use to view the file now, even without logging in to Google.

And what is worse, is that the file status still shows as “Restricted: Only people added can open with this link” when in reality the file status should be changed to “Anyone with the link can view the file”.

This is a Critical Security issue.

When a file is set to RESTRICTED, it should only be viewable by those added that have a Google account to login with first, and should NEVER be viewable by anybody else even if they have the link.

Another -1 for Google 🙁

Here is thread on Stackoverflow:
https://stackoverflow.com/questions/71130234/critical-security-issue-with-google-drive-when-sharing-file-as-restricted

Here is a link on the Google Issue Tracker:
https://issuetracker.google.com/issues/215152601

How to convert Presearch tokens (PRE) to ETH (or BTC or cash) – PRE tokens

Presearch is working on a decentralized search engine: https://presearch.io/

Their crypto currency token is PRE

I have built up some PRE by using their search engine, and wanted to cash them out but found the process was not very easy because many exchanges do not accept PRE and therefore won’t exchanage it. So it took me several days to figure out how to do it.

STEP 1
Follow Presearchs own instruction by creating a wallet with My Ether Wallet (https://www.myetherwallet.com) and withdraw your tokens and send them to your new MEW wallet.

STEP 2
In order to exchange your PRE for something else, you will need to have some ETH in your MEW wallet to pay for the gas.
I found .005 ETH was a good minimum number.
You will need to purchase the ETH on another exchange and then send it to your MEW wallet.

STEP 3
NOTE: I recently noticed that CoinGetCoin.com website is no longer working. If you have alternative suggestion, please post in the comments.
You can then use CoinGetCoin to make the exchange (https://coingetcoin.com/#how-it-works).
You tell it how many PRE you will send, and it will tell you how many ETH you will get back.
I like this platform because you just send the PRE and it will automatically send ETH back to your wallet.
Specify the approximate amount of PRE you are going to send (does not need to be exact), and then specify the wallet address where you want the ETH sent after the exchange (I just sent it back to my MEW wallet).
CoinGetCoin will then give you a wallet address and you have 24 hours to send your PRE.
Be sure to note the minimum PRE that they will accept.

STEP 4
Go back to your MEW wallet and specify the address CoinGetCoin gave you, and send your PRE.
You can go back to CoinGetCoin and it will tell the progress (when it receives your PRE and when it sent the ETH back).
I have made a couple exchanges using CoinGetCoin and it took less than 30 minutes each time.

STEP 5
Now that you have ETH in your My Ether Wallet instead of PRE, you can do what you want with it.
For me, I sent it to my Coinsquare.com account and converted it to dollars and withdrew it to my bank account.