Last active
January 16, 2018 01:25
-
-
Save alpha1/f7c6fd6f7feb06d6de32c6170cd44d60 to your computer and use it in GitHub Desktop.
CE This Week Migration
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#prior to running these, grab all held emails from delivra and import as suppressions to phplist. | |
#Server 2 - All active subscribers from MYB | |
SELECT | |
phplist_user_user.id, | |
TRIM(LOWER(phplist_user_user.email)) as 'email', | |
'1' as 'Business' | |
FROM phplist_listuser | |
LEFT JOIN phplist_user_user ON phplist_listuser.userid = phplist_user_user.id | |
where `listid` = 3 | |
AND ( | |
phplist_user_user.blacklisted = 0 | |
AND phplist_user_user.confirmed = 1 | |
) | |
#Server 2 - All active subscribers from TT | |
SELECT | |
phplist.phplist_user_user.id, | |
TRIM(LOWER(phplist_user_user.email)) as 'email', | |
phplist_user_user.uniqid, | |
'1' as 'Business' | |
FROM phplist.phplist_listuser | |
LEFT JOIN phplist.phplist_user_user ON phplist.phplist_listuser.userid = phplist.phplist_user_user.id | |
where `listid` = 4 | |
AND ( | |
phplist_user_user.blacklisted = 0 | |
AND phplist_user_user.confirmed = 1 | |
) | |
#Server 2 - All active subscribers from RM | |
SELECT | |
phplist.phplist_user_user.id, | |
TRIM(LOWER(phplist_user_user.email)) as 'email', | |
phplist_user_user.uniqid, | |
'1' as 'Business' | |
FROM phplist.phplist_listuser | |
LEFT JOIN phplist.phplist_user_user ON phplist.phplist_listuser.userid = phplist.phplist_user_user.id | |
where `listid` = 5 | |
AND ( | |
phplist_user_user.blacklisted = 0 | |
AND phplist_user_user.confirmed = 1 | |
) | |
#Server 2 - All folks who signed up for Workforce Development | |
SELECT | |
phplist.phplist_user_user.id, | |
TRIM(LOWER(phplist_user_user.email)) as 'email', | |
phplist_user_user.uniqid, | |
'1' as 'Business' | |
FROM phplist.phplist_listuser | |
LEFT JOIN phplist.phplist_user_user ON phplist.phplist_listuser.userid = phplist.phplist_user_user.id | |
where `listid` = 30 | |
AND ( | |
phplist_user_user.blacklisted = 0 | |
AND phplist_user_user.confirmed = 1 | |
) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment