Can I load data from a file on the server side? - server

Hi,
my server structure is like this
/server
/www
/www directory is accessible on the internet and /server is not. But I have a xml file inside /server I need to open from a js file inside /www in order to get data from. Is this possible?
Thank you.

Related

keyclaok 20.0.1 : How to import realm from json file?

From the documentation one can read:
bin/kc.[sh|bat] start --import-realm
When you set the --import-realm
option, the server is going to try to import any realm configuration
file from the data/import directory. Each file in this directory
should contain a single realm configuration. Only regular files using
the .json extension are read from this directory, sub-directories are
ignored.
Where to put my .json file ? they are saying data/import, but where exactly ?
PS: I'm not running keycloak in a docker container
In the root of the Keycloak project create the folder data/import and add your data into it.

Azure data factory - SftpPermissionDeniedException

Using a copy data activity I want to upload files to an SFTP service, but receive the following error message:
I can upload files via a simple linux sftp client to the target folder with the same user, and also able to create files and folders within the target folder(but not in its parent folder, which is the root folder).
"Upload with temp file" option is set to false.
Any idea?
To confirm which user your build runs as you can run the whoami command as a part of your build process.
Solution:
Store things inside of a folder that the user running the build has permissions to.
Change the ownership of the directory with the chown command before trying to write to it.
Refer - https://support.circleci.com/hc/en-us/articles/360003649774-Permission-Denied-When-Creating-Directory-or-Writing-a-File

UNLOADing file onto client system

I'm wondering how I would UNLOAD a file from a SQL Anywhere v10 database onto a client computer. I have multiple servers (30+) at different locations, this is the query I have been using to UNLOAD on a local server:
UNLOAD
SELECT tran, id, amount, date, collection, impacts, type
FROM transactions
ORDER BY tran_num
TO 'C:\Users\administrator\Desktop\Clinic.txt' DELIMITED BY '|'
APPEND ON
QUOTES OFF
I'm looking to modify this to be able to unload from the remote servers but the file to generate at my local/client location where I am sending the query. I am using DtSQL to connect to the database remotely. Anyone have a solution?
share a folder on the client machine and then use the full network path to that client's folder in the unload statement. like '\\targetPC\SharedFolder\Clinic.txt'
or
share a folder on the DB server and then copy the file to your target machine after the unload

prestashop 1.6 localhost redirects to live url

I have a prestashop store.I have downloaded the source from ftp and imported the database as well.I want to set it up on my localhost.I am using wamp on windows 7.I have set my db credentials in setting.inc.php.When I access the front end it redirects me to the live url.The admin is ok ie its accessing through localhost.
I have edited the ps_shop_url table and changed the domain and domainssl to localhost and physical url to /myproject/.
I have also changed the ps_configuration table and changed PS_SHOP_DOMAIN = localhost and PS_SHOP_DOMAIN_SSL=localhost
I have also deleted my .htaccess file.
But the issue is still there.It redirect me to the live url.I have spent alot of time but in vain.Kindly help me I am new to prestashop.I have installed prestashop 1.6 version.
How to migrate PrestaShop from Your web server to local? (and inversely)
25 July 2015 Tutorials
That task is quite easy in most cases. But you must remember about few essential things.
Moving from SERVER to LOCAL PC
I assume you’ve configured PHP, Apache and MySQL on your local machine. If you don’t have those things installed, find some informations about how to do it. If you are using Windows I can suggest you installing XAMPP application.
Download all website files from your FTP and put them to the local directory.
Next, let’s export the database from phpMyAdmin to the .sql file and download it. Import that file to your local database.
Now it’s a time to make some changes in your local database, files and BackOffice.
Database:
Go to the table PS_SHOP_URL and change values of following columns:
– domain localhost
– domain_ssl localhost
– If your PrestaShop is located in some addictional directory, set the value of physical_uri (for example, if it’s in the ‘shop’ directory, write /shop/ there)
In the PS_CONFIGURATION table change the value of PS_SHOP_DOMAIN and PS_SHOP_DOMAIN_SSL
Files:
Set the debug mode ON in config/defines.inc.php
define('_PS_MODE_DEV_', true)
Set your local database parameters in config/settings.inc.php
If your PrestaShop is located in some addictional directory (for example /shop/), edit the .htaccess file. It’s located in PrestaShop main folder. Add to this part…
RewriteRule . - [E=REWRITEBASE:
1
RewriteRule . - [E=REWRITEBASE:
…that directory. Complete code should look like this:
RewriteRule . - [E=REWRITEBASE:/shop/
1
RewriteRule . - [E=REWRITEBASE:/shop/
BackOffice:
Advanced Parameters -> Performance
Select “Force compilation” in smarty settings, disable the cache and clear the cache using button located in upper right header of page.

How to migrate/shift/copy/move data in Neo4j

Does any one know how to migrate data from one instance of Neo4j to another. To be more precise, I want to know, how to move the data from one instance of Neo4j on my local machine to another on remote machine. Does any one have any idea about it.
I'm working on my windows machine with Eclipse and Embedded Neo4j . I need to transfer this data to remote Neo4j instance on a Centos machine. Please help me with this.
Not sure how to do it for "embedded neo4j db".
But for standalone and in case you have something like the command line tool "Putty" on your windows machine, this should work. Instead of $NEO4j_HOME you can also use the normal path without the env variable.
$NEO4J_HOME/bin/neo4j stop
cd $NEO4J_HOME/data
tar -cvf graph.db.tar graph.db
gzip graph.db.tar
scp -i ~/some_path/key_for_remote_server.pem ./graph.db.tar.gz username#your_remote_domeain.com:~/
ssh -i ~/some_path/key_for_remote_server.pem/ username#your_remote_domeain.com
On your remote server (at least this works for ubuntu):
Maybe you need to use "sudo" (prefix the commands with sudo).
mv ./graph.db.tar.gz /some_path/
cd /some_path/
gunzip graph.db.tar.gz
tar -xvf graph.db.tar
$NEO4J_HOME/bin/neo4j start
$NEO4J_HOME/bin/neo4j status
You can migrate the data by using the apoc procedure by running the below query in the cypher shell from where the data needs to be exported:
CALL apoc.export.cypher.all('myfilename.cypher');
This will download the file with cypher queries in the import folder
Go the database instance where the data needs to be imported and copy the file in the import folder. Run the below command using the cypher shell:
apoc.cypher.runFile("myfilename.cypher",{}) yield row, result;
For more advanced options follow the below links:
https://neo4j.com/docs/labs/apoc/current/export/cypher/
http://neo4j-contrib.github.io/neo4j-apoc-procedures/3.4/cypher-execution/run-cypher-scripts/
I found out the following workaround for copying the data from a server in the cluster to all others, after using the neo4j-import tool:
Stop all nodes.
On the new node/server, where you need your data to be copied, you have to create the database folder for that graph (in my case loadTest):
/neo4j-enterprise-3.1.0/data/databases/loadTest.db
Then, the source node/server that is holding the data, you have to copy here the neostore.id file to the destination server db folder (loadTest.db from the previous step).
Start all nodes. In the background neo4j will copy data from other cluster servers to the new node.
For embedded mode , you would just need to locate the graph neo4j-db folder location then zip and send it to the remote system.
In your code where you would have called graphdatabaseservice , you would have given the target location
Check if its relative path then the database might be in your project folder .
Now for running the db instance on browser , you will need to use the neo4j communty server and point it to the folder containing the index folder. So if your neo4j-db is located at $project/tmp/neo4j-db then you will give the file path till this folder(the index folder will be inside this folder)
Edit
The folder that will contain the schema and index folders needs to be zipped. You can upload and unzip the folder at a certain location using Putty on your standalone server. Then just change the org.neo4j.server.database.location in conf/neo4j-server.properties file.