migration from normal chat to ejabberd chat - mysql

I have been using the normal javascript ajax chat i created manually. I also used this same format to create phone android messenger app. But it was using normal sockets.
so i have migrated to using ejabberd IM server and have developed the xmpp client messenger and it is working well with mysql module configurations.
But now i have history chats for messages by users and want to maintain the message. So i want to transfer these messages to the new database table called archive under ejabberd.
I have failed import the messages as they are very many in thousands.
so if some one know a script i can use to do the migration of data to the new database that will be good.

To my knowledge, there is not template migration script you can adapt already, but that would make a good contribution for ejabberd.

Related

saving users in custom table in openfire xmpp

I have installed openfire on windows machine and pointing to our mysql database.I have created test users in openfire and testing with xmpp client on my machine . Everything is working fine.
I have opened our mysql database and seen so many tables are created from openfire where tablename starts with of like for example ofuser which stores user registration information.
Now instead of storing user registration information in ofuser ,I want to store user registration information in my custom table like for example chat_registrations.
Is it possible in openfire, if so how to do it?
You can do it but for this you have to modify openfire from source and build the system for yourself. To do this fork openfire from github, clone your repository in pc, open source code with you favourite IDE, then modify openfire's sql queries related to ofUser table. You will get them in src/database/openfire*.sql . Build the modified system and install it to server.

How to access server MySQL database from iOS app

I'm trying to write an iOS app using Xcode.
A simple login prompting username and password.
I have no idea how to open a database connection to validate the username and password.
The database I use is mysql.
I tried using this link http://macbug.org/macosxsample/mysql#.Ur8AYBbtGPF
but I get an error when I tried to add libmysqlclient.a to the frameworks and library.
If your database is on a server somewhere, then you would generally not have your iOS app interact directly with the database server, but rather you would write a web service that the app would interact with (via NSURLConnection, NSURLSession or something like AFNetworking), and the web service would interact with the MySQL database.
In terms of how to write a web service, often, when people are writing their first web service, they'll use some simple technology like PHP. Do you know what options you have on your server? If PHP is an option, then you can check out Ray Wenderlich's How to Write a Simple PHP/MySQL Web Service. Then check out How to Write an iOS App that Uses a Web Service.
You should use SQLite instead of MySQL for iOS application. You are referring MacOSX application tutorial. try this http://www.raywenderlich.com/913/sqlite-tutorial-for-ios-making-our-app

connecting an ios app to send information to a mysql database

Im doing my final project which is a taxi booking service. i intend to make an ios app for the customer so that they can book a taxi. the request will then be sent to the mysql database (held at the taxi base). i want to no how can i send the information from the app to the datatbase; and the datatbase to send a confirmation message back to the app confirming the taxi has been booked!>>>>>
i have read a lot about web servers but am very confused. can i use an web server e.g. windows home server 2008? any help would be appreciated.
I am not familiar with Windows home server 2008, but I'm pretty much sure that you can use it for your project.
If you want to keep things simple,
Just install XAMPP server which comes with all the components you need to work on this project including PHP and MySQL. It is one of the easiest servers to work with and most of all, its free and open source. http://www.apachefriends.org/en/xampp-windows.html
Then write the business logics inside your Web App using whatever the programming language you want to (for this one PHP would be enough, or choose Java if you want to have a more complex scalable solution). Writing data to a MySQL database using PHP is very easy and you can find ton of tutorials and sample source codes in the internet.
Now your web app is all set, the next step is to expose these services using REST where an iPhone can communicate with your services. Use JSON for interacting with your Web server from iPhone. Again, there are tones of tutorials on how to write a JSON RESTful service using PHP.
Finally in your iPhone app, you can access the service exposed from the server for saving data as well as to retrieve anything from it through JSON. For making this, use a good Objective-C framework such as AFNetworking. It comes with the JSON parser as well. Ref. http://afnetworking.com
Good luck with your project !
RESTful web services are going to be your best friend here.
Create a server side program in django or python or whstever. Connect it to a database (mysql).
You can host it on Amazon Web Services. I think they have windows 2008 instances. I would personally use the amazon linux ami.
Use afnetworking to invoke a get or a post on the server app and you are off to the races.
take a look at this open source taxi project
its work with RESTful web services but its better to forget about Microsoft Windows its better to use Linux hosting for your web service.

Connect iPhone app to remote database server

New to iPhone dev here. Just wondering what's the best way to connect an iPhone app frontend (based on Cocoa touch ) to a php/MySql based backend?
The iPhone application will frequently access and change data stored on our server.
Read about mysql framework and MCPKit framework but these are for cocoa not for cocoa touch.
so can I access mysql based backend without any web service on server side.?
Many thanks
You can create a REST Api for your PHP/mySQL. Something like this
https://github.com/gilbitron/Arrest-MySQL
Then on the iOS side of things, you can use something like AFNetworking, to make requests to your server.
https://github.com/AFNetworking/AFNetworking

A rails web app, quickbooks, and mysql

I've gotta use the inventory from quickbooks in my rails web app...it would be nice if I could get quickbooks to use mysql, as that way I could just use mysql between the app and quickbooks, which would make things easy.
Does anyone know how to get quickbooks to use mysql? Or will I be forced to have my app communicate directly with quickbooks, which I wanna avoid :P
There are a few ways of integrating with QuickBooks, but if it's a web application, your best bet is to use the QuickBooks Web Connector, or to use a commercial package for SQL access.
The Web Connector is the only Intuit-supported solution to integrating with QuickBooks from a web application. Basically, you build a SOAP server / Web Service which speaks a specific set of methods. The Web Connector then is installed on the machine running QuickBooks, and polls your web service asking "Hey, got anything for me to do?" Your web service can then respond with qbXML requests (examples of qbXML here: QuickBooks qbXML Examples) which tell the Web Connector "Add this customer: ..." or "Send me invoices which match: ..." or etc. etc. etc. The Web Connector then relays those requests to QuickBooks, QuickBooks processes them, and the response is relayed back to your web service. Your web service might then process the response somehow, and then send the next request over to the Web Connector. This can continue in a loop for as long as you like, continuing to send requests to QuickBooks and receiving the responses.
You might also look into AccessBooks and QODBC. Both are commercial wrappers around the QuickBooks qbXML SDK which allow direct SQL access to QuickBooks.
Here is some additional information on my QuickBooks Integration Wiki about how to integrate applications with QuickBooks.
You might also want to search around on Google. I know there were some QuickBooks Rails packages/gems out there somewhere, but last I looked it did not support the QuickBooks Web Connector. Instead, the Rails application had to be installed on the same machine as QuickBooks, and it communicated via COM.
Pretty sure you will have to interface with Quickbooks directly. The other problem is going to be that because Quickbooks is a client-side application you will need to have an app on the client that pushes the data to the server. It's definitely doable.
Alternatively, you could just use the export functions of Quickbooks to periodically export the inventory as CSV.
http://behindlogic.com provides a Rubygem (for sale) that will deal with all of the pains of QBXML for you, and an HTTP Connector for QuickBooks that allows you to send/receive messages with QuickBooks through HTTP, which opens the door for connecting from another computer. The gem has an adapter built to use the Connector as well, so you can very quickly get up and running with QuickBooks on Windows and your Rails app on Linux or on your development Mac.
EDIT: Unfortunately, the maintainer of Behind Logic and the gem mentioned above has passed away. I hate bringing this up, however it took me a while to figure out why the GitHub repo was inactive and the site had gone down.
We have been using the Web connector for a while now, and let me tell you its been pretty smooth so far. Though the Intuit Quickbooks SDK doesn't let you do wt exactly QB UI would let you. Problems occur especially when you want to enter group items to QB using the SDK. Use a webservice and let it build requests and process responses and push the required data to your database which can simply be anything from a SQL server to MySql/Oracle etc etc. Using this approach good amount of error handling can also be done.