back to phpList.org

Import lists from command line


#1

HI!

is there any way to import lists via command line?

i have tried:

./bin/phplist -pimport

but i get only this…

phpList version 3.3.1 © 2000-2018 phpList Ltd, http://www.phplist.com
Usage: /var/www/html/lists/admin/index.php -p page [other parameters]

Thanks…

PetePot


#2

@PetePot There must be something wrong with your phplist shell script because the command works for me.

php /home/duncan/www/lists/admin/index.php -p import -f /home/duncan/Downloads/import.csv -c /home/duncan/Development/PHP/phplist/config.php -l 1

But it then fails.

Error: Invalid security token, please reload the page and try again

Instead you can try the Subscribers plugin, to which I have added a command line page that uses the core phplist processing, see https://resources.phplist.com/plugin/subscribers#import_from_the_command_line


#3

Thanks a lot Duncan… i will try it with your plugin script!! is it possible to set the list-name those emails should belong to?


#4

@PetePot You need to specify the id of the list in the command. That is explained in the documentation page.


#5

sorry but I do not see the script, am I missing something. Thanks


#6

I was able to make it work.